Re: Display selectd sub-menuItem in NSPopUpButton
Re: Display selectd sub-menuItem in NSPopUpButton
- Subject: Re: Display selectd sub-menuItem in NSPopUpButton
- From: Graham Cox <email@hidden>
- Date: Sun, 16 Feb 2014 11:11:38 +1100
On 16 Feb 2014, at 5:00 am, Leonardo <email@hidden> wrote:
> I think there should be a way to just open and display the submenus and
> highlight a menu item, even if the mouse is elsewhere.
But there isn't.
You might be able to come up with a whole bunch of code that follows the tree back to the root parent item, displays that (there is API to pop up a menu positioned at a given item), then open the submenu(s) down to the selected item, but it's going to be complicated and ultimately, unique to your app, since it's not directly supported in the NSMenu API.
Maybe you should just consider a different approach, such as lists, or NSPathControl, which are able to indicate a current state. Menus are designed for brief transitory indications of state while the user is a highly temporary 'mode', i.e. dragging the mouse through some menus. You are trying to use it for something it wasn't designed for.
--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