Displaying Double-Click Context Menu

David Butler's icon

I'm trying to add a double-click context menu (exactly like midiin) to my external object. I've managed to do it for the Windows build using the Windows API, not I'm not sure how to achieve this on OS X. Has anyone done this?