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 <pe...@stairways.com.au>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 (Cocoa-dev@lists.apple.com)
>> 
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>> 
>> This email sent to steven.degu...@gmail.com
>> 
> 
> 
> 
> -- 
> Steven Degutis
> http://www.thoughtfultree.com/
> http://www.degutis.org/
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org
> 
> This email sent to devli...@shadowlab.org

-- Jean-Daniel




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to