I am trying to get my application menu (About/Preferences/Services/Hide/Quit) 
set up. My app has no need for NIBs, aside from that I've been told that one is 
required to set up the application menu due to some indeterminate Cocoa 
hard-wiring. I'm correspondingly clueless about IB and happy to stay that way 
as much as possible, no value added.

I opened Interface builder and selected the Main Menu template. I edited the 
menu a tiny bit to set up the name of my app in a few spots instead of 
NewApplication. The file contains a File's Owner, First Responder, Application, 
and Main Menu items. I saved it out as mainmenu.xib and have set it up in my 
project as the main nib (selected my app's target, set my file as the main nib 
on its properties). I can see the XIB file getting compiled with my project in 
the build output.

When my app starts, at the place I'd like to set the main menu up (before the 
run loop starts, during my app's initialization), [NSApp mainMenu] is nil, so 
it hasn't been read yet. If I hand it my app's menu (File/Edit/etc), when the 
app starts I see my menu, but not the application menu About/Preferences/etc. I 
can understand that----assuming the NIB gets read at some later time---in 
[NSApp run]???

I commented out my line that does [NSApp setMainMenu:mine] --- now, once the 
app starts, there is only my application's name on the menu bar, with no sign 
of the menu from my NIB.  So my nib's menu didn't load at all. What sort of 
magic incantation do I need to get that to happen?

If I can get the mainmenu NIB to load, I'm expecting to use NSApp mainMenu and 
setMainMenu to hack it up to patch in my application menu. All of this is 
really a bother though, I don't see any intrinsic reason why this should be 
required.  I could easily supply the application menu myself.

Save yourself the typing on the "I should be building everything in Interface 
Builder" speech, thanks. Not happening. App works nicely without, sans app menu.

Thanks.



      
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to