Re: [NSapp mainMenu] returns nil - Solution :-)
Re: [NSapp mainMenu] returns nil - Solution :-)
- Subject: Re: [NSapp mainMenu] returns nil - Solution :-)
- From: Christian Stieber <email@hidden>
- Date: Tue, 04 Apr 2006 13:20:09 +0200
At 10:46 04.04.2006 +0200, Christian Stieber wrote:
Although, something I still want to try some time is to use
Interface-Builder to just make a dummy menu to kickstart things,
load that, and see it if helps.
Well, that seemed to be the key. I made a Dummy nib with
Interface builder, deleting everything (except the main
menu, of course) that it would let me, and just doing
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"Dummy" owner:NSApp];
FixMenus([NSApp mainMenu]);
if (WTG_Framework_Preferences_Init())
...
to initialize the Cocoa-GUI. No NSApplicationLoad() --- if I
call that, I get a double-system menu containing the one from
IB and the system-provided one, but the system-provided one
doesn't work, and the dock-Quit won't work either. If I don't
call NSApplicationLoad() then everything is fine. Don't need
NSApplicationMain() either.
[NSApp mainMenu] now returns a non-nil menu as well, and I can
edit it using the normal NSMenu/NSMenuItem classes to localize
it, and probably (should the need arise) add new entries. So,
all looks fine now :-)
I even seem to get the Edit menu now, and I hope the shortcuts
work as well. At least that explains why I never found out how
to turn on the system-provided Edit menu --- there is none :-)
Christian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden