Hi,
I'm trying to show a pop up menu on mouse down on a button. The button should appear pressed while mouse down, and be "un pressed" on mouse up regardless of any of the menu item been selected. Similar to the Expose/Space Preference panel "+" button for adding application.
So far I tried 3 methods:
Sent action when button is click. But here the pop up menu appear on mouse up instead of mouse down
Subclass NSButton and overwrite mouseDown:. The pop up menu appear on mouse down, I can select any of the menu item. But when the pop up menu is gone, the button appeared pressed. Hence I need to click once again to "un press" the button before I can get the same action again.
NSEvent addLocalMonitorForEventsMatchingMask. Similar behavior to 2.
Any suggestion? I guess method 2 or 3 is the right way, just need to "un press" the button on mouse up.