Re: NSApp's run method and menus...
Re: NSApp's run method and menus...
- Subject: Re: NSApp's run method and menus...
- From: John Stiles <email@hidden>
- Date: Mon, 16 Jul 2007 09:49:33 -0700
Have you called NSApplicationLoad before setting up your menus?
On Jul 15, 2007, at 5:05 AM, Jeff Bland wrote:
Is there anything that [NSApp run] does to initialize menus? In a
program,
I'm generating menu's like so:
NSMenu *file = [[NSMenu alloc] initWithTitle: @"File"];
[menu setSubmenu: file forItem: [menu itemWithTitle: @"File"]];
and using [NSApp setMainMenu: menu] to make it the application menu.
If I don't call [NSApp run] the menu's do not show up other than
the apple
menu and the menu with the application name. If I do call [NSApp
run], they
work perfectly. My application employs it's own event loop because
it needs
to retain program control (ie it doesn't wait for user input or
some event
to do something - it needs to do constant processing).
Of course I could call [NSApp run], and make a custom event that
breaks out
of the loop then put my event loop to work, but that feels like a
bit of a
hack just to display some menus - everything else runs fine without
ever
calling [NSApp run].
Thanks,
- Jeff Bland
_______________________________________________
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:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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