On Feb 4, 2013, at 11:15 AM, Geoffrey Holden wrote:

> In the same way that it is possible to bind NSTableView to an NSDictionary,
> is it possible to bind NSMenu to an NSArray?  I have an array of
> dictionaries.  The dictionaries contain the menu name, and may contain a
> further array of dictionaries, to a potential level of eight deep.
> 
> I'd like to be able to turn this into a nested NSMenu.  I don't know if
> I've explained myself clearly - but does anyone have any idea how I might
> go about it?  Is there a standard method that I should know about?
> 
> If there isn't a standard method then don't worry about it - I'll work it
> out.

NSMenu does not have any bindings. All possible bindings are documented here: 
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CocoaBindingsRef/CocoaBindingsRef.html

NSMenu does use delegation and those methods should do what you need, although 
it is fairly easy to maintain a menu and synchronize it with the kind of data 
structure you are talking about.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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

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

Reply via email to