Re: Dynamically populate a popup menu
Re: Dynamically populate a popup menu
- Subject: Re: Dynamically populate a popup menu
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 17 Feb 2010 17:22:16 +0100
Yes, but using the notification does not solve the OP problem that is:
I have to much submenu and item to compute then at one time.
Not to mention the fact that he asked for a popup menu, but he does not talk about a popup button.
That said, having more than one level of submenu is again Interface Guidelines (see "Hierarchical Menus (Submenus)" section in Interface Guidelines):
"Because submenus add complexity to the interface and are physically more difficult to use, you should use them only when you have more menus than fit in the menu bar or for closely related commands. Use only one level of submenus. If a submenu contains more than five items, consider giving it its own menu."
Using a Menu to browser the disk is maybe not the way to go.
Le 17 févr. 2010 à 17:00, Steven Degutis a écrit :
> While NSMenuDelegate isn't wrong per se, I still prefer to use the NSPopUpButton's notification myself. Touching the button's internal menu seems like dipping my fingers where they don't belong.
>
> -Steven
>
> On Wed, Feb 17, 2010 at 10:41 AM, Jean-Daniel Dupas <email@hidden> wrote:
>
> See NSMenuDelegate protocol.
> There is some method to dynamically populate the menu.
>
> Le 17 févr. 2010 à 16:09, Steven Degutis a écrit :
>
> > Check out NSPopUpButton's NSPopUpButtonWillPopUpNotification
> >
> > On Wed, Feb 17, 2010 at 2:49 AM, Peter N Lewis <email@hidden>wrote:
> >
> >> Is there any way to dynamically populate a popup menu on the fly (as it is
> >> exposed)?
> >>
> >> For example, a popup menu that displayed the harddisk hierarchy would need
> >> this sort of thing - you wouldn't want the entire thing populated as soon as
> >> you click the popup menu, it would take forever and the user would never see
> >> most of it.
> >>
> >> Can it be done by subclassing NSMenuItem etc?
> >>
> >> The only alternative I can see would be some sort of custom control based
> >> on NSBrowser, but that would be a lot uglier for this sort of selection.
> >>
> >> Thanks,
> >> Peter.
> >>
> >> --
> >> Keyboard Maestro 4.0.2 now released! Brand new interface!
> >>
> >> Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
> >> <http://www.stairways.com/> <http://download.stairways.com/>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >>
> >> 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
> >>
> >
> >
> >
> > --
> > Steven Degutis
> > http://www.thoughtfultree.com/
> > http://www.degutis.org/
> > _______________________________________________
> >
> > 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
>
> -- Jean-Daniel
>
>
>
>
>
>
>
> --
> Steven Degutis
> http://www.thoughtfultree.com/
> http://www.degutis.org/
-- Jean-Daniel
_______________________________________________
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