how to have a pop up menu from an ordinary button?
how to have a pop up menu from an ordinary button?
- Subject: how to have a pop up menu from an ordinary button?
- From: Rua Haszard Morris <email@hidden>
- Date: Fri, 8 Aug 2008 09:53:48 +1200
I am trying to implement a mini-size, square bevel button that pops up
a menu, i.e. a popup button with a square appearance and mini size,
but have not found a way to achieve this.
NSPopupButton does not support square button appearance, and doesn't
support setControlSize: (though it can of course be an arbitrary size).
I have seen some suggestions for how to achieve this, for example
making a NSPopupButton over the top of a square NSButton and setting
the NSPopupButton transparent. This works but there are draw issues;
sometimes a rounded white area appears around the NSButton (note that
I have set the size & location of the popup button to match the
button, so the clicks are handled appropriately). I also had a look at
NSMenu popUpContextMenu:, but this did not seem appropriate, as it
seems solely for right-click/context menus.
How can I do this? I want to avoid having to write the mouse tracking
code if at all possible, so the popup behaves exactly like a system
one. I'm not clear on how to do this either..
thanks
Rua HM.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden