NSApp's run method and menus...
NSApp's run method and menus...
- Subject: NSApp's run method and menus...
- From: "Jeff Bland" <email@hidden>
- Date: Sun, 15 Jul 2007 21:05:17 +0900
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:
This email sent to email@hidden