Re: How can I keep an NSPopUpButton open after the user selects a menu item?
Re: How can I keep an NSPopUpButton open after the user selects a menu item?
- Subject: Re: How can I keep an NSPopUpButton open after the user selects a menu item?
- From: Graham Cox <email@hidden>
- Date: Mon, 15 Jun 2009 10:52:08 +1000
On 14/06/2009, at 4:20 AM, Dennis Hartigan-O'Connor wrote:
I have an NSPopUpButton providing the NSMenu for a status item with
a custom view. The popup button displays a list of links. When the
user selects a link from the list, the link is displayed in the
user's browser (in the background).
Naturally, the menu closes every time the user selects a link.
I would like to change this: I want the menu to stay open while the
user clicks on various links, all of which can be opened in the
background. The menu can then go away when the user clicks elsewhere.
How can this be accomplished? Should I subclass NSMenuItem and
intercept the mouse clicks somehow? Overlay a transparent NSView on
the popped-up menu and, again, intercept the clicks somehow? I make
these suggestions blithely, but I would have trouble implementing
either of these...pointers to the right methods for override would
be appreciated.
It doesn't sound like a menu is the right UI widget for this job.
How about a list that you can collapse (hide) or show? Or a list in a
window that floats. Pop-up behaviour should be strictly for operations
that represent momentary actions. If you persist with the menu
approach, users will likely become frustrated that it works
inconsistently with the rest of the system and keeps trapping them
into a (probably unwanted) mode.
--Graham
_______________________________________________
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