Re: How does a new app learn about its menu?
Re: How does a new app learn about its menu?
- Subject: Re: How does a new app learn about its menu?
- From: Quincey Morris <email@hidden>
- Date: Fri, 17 Apr 2009 13:19:57 -0700
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 (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