On Tue, Sep 30, 2008 at 1:20 PM, Matthew Gertner <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to add a new menu to the main menu of my application using > Cocoa. I thought something like this would do the trick: > > NSMenu* menu = [[NSMenu alloc] initWithTitle:@"foo"]; > NSMenuItem* item = [[NSApp mainMenu] addItemWithTitle:@"foo" > action: nil > keyEquivalent: @""]; > [item setSubmenu:menu];
You need to add that menu to the menubar. Use -[NSApplication mainMenu] to get at the menubar and then add your menu to it. -Colin _______________________________________________ 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]