-
-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Labels
AppKitRelated to AppKit.framework or CocoaRelated to AppKit.framework or CocoaFrameworkAffecting a framework bundle or tools that build themAffecting a framework bundle or tools that build them
Description
Menus are normally defined in the app's nib file. For a nibless app, the menus can be created from code, but the Application menu (the bold one with the app's name and the quit option) should always be created automatically if one is not provided.
Move something like this into NSMenu's init or NSApp's setMainMenu:
// Hack up an application menu since we don't load a nib
NSMenu *appMenu = [[NSMenu alloc] initApplicationMenu:@"Client Demo"];
NSMenuItem *appMenuItem = [NSMenuItem new];
[appMenuItem setTitle:@"Client Demo"];
[appMenuItem setSubmenu:appMenu];
[menu insertItem:appMenuItem atIndex:0];
[NSApp setMainMenu:menu];
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AppKitRelated to AppKit.framework or CocoaRelated to AppKit.framework or CocoaFrameworkAffecting a framework bundle or tools that build themAffecting a framework bundle or tools that build them