On Apr 17, 2009, at 12:23, Darren Minifie wrote:

I have what I think is a pretty straight forward question about an app's main menu. When creating a new Cocoa app in xCode, the final build seems to just know about how to load its menu. there doesn't seem to be any mention of the NSMenu object in the info.plist, the sourcecode, or a connection in interface builder. I'm curious to know how NSApplication first finds and sets its main menu. The reason I ask is, I would like to learn how to build applcations using a plugin approach (kindof like eclipse / osgi) and it would be great to be able to dynamically add new menu entries based on what
plugins are loaded at runtime.  thank you for your help.

The application loads the main menu from the main menu nib file, and you can specify the name of that file in the build target's properties (the same place where you put the bundle identifier and the document type supported by the application).

If you want to add things to the main menu, look at NSApplication's mainMenu method. You don't have to care how it gets there, if all you want to do is add things to it.


_______________________________________________

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