Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
429
31
I have a Window Menu in my application. It has four items: Minimize, Zoom, a separator and Bring All to Front. When I run the app xCode has added 10 items: Move Window to Left Side of Screen, Move Window to right Side of Screen, Enter Full Screen (not enabled, this isn't a full-screen app), Show Previous Tab (not enabled), Show next Tab(not enabled), Move Tab to New Window (not enabled), Merge All Windows (not Enabled), Show Tab Bar, Show All Tabs, a separator bar, Bring All to Front, and another separator Bar. Bring All to Front could be useful. Showing the tab bar could be useful when I have more than one window open. Looking at the .Xib I don't see any way to modify this. Is there any way to modify this or is it built automatically by XCode?
 

Red Menace

macrumors 6502a
May 29, 2011
583
230
Colorado, USA
The windowsMenu is an application property, so those get put in there to support the standard window stuff. If you aren't using and don’t want the extra items, one way is to create your own menu with the desired actions and just not set it as the NSApp.windowsMenu.
 

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
429
31
Looking at it in the.xib what you say isn't there. It's just an NSMenu and the menu is custom for this application. Where would I find the NSApp.windows menu property?
 

Red Menace

macrumors 6502a
May 29, 2011
583
230
Colorado, USA
The Apple Menu, Window menu, and Help menu all get extra stuff added to them. In the default MainMenu xib, those are systemMenu items, which are set when NSApplication initializes the sharedApplication object. To not use the standard behavior, you would need to use your own Window menu and/or set the NSApp.windowsMenu to nil.
 

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
429
31
Calling NSApplicationMain initializes the app and loads the MainMenu.xib. I tried calling [NSApplication sharedApplication].windowsMenu = nil; and NSApp.windowsMenu = nil; after this but before returning the integer returned by NSApplicationMain and also in the init method of my AppController. These are executed before the app's menu bar is displayed. The App still adds the stuff to the windows menu.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.