0
votes

the problem I'm having is I cannot add a menu to my app programmatically!

here's where I'm at:

in app delegate applicationDidFinishLaunching:

create a window and make key and order front.

EDIT:( here if I log [NSApplication sharedApplication].mainMenu prints (null) ) anyway...

create a NSMenu object and [[NSApplication sharedApplication] setMainMenu:myMenu] also tried [[NSApplication sharedApplication] setMenu:myMenu]

build/run

menu is not there!

EDIT2: ( if still not understanding: )

make a osx app, remove the menu object, run, you'll still see a menu up there with the name of your app, you click it, it turns blue but no submenus, now how do I get a pointer to that!

1

1 Answers

0
votes

You won't be able to do this as the OSX menus conform to the Aqua layout. Is there any reason why you'd remove it completely?

It's probably going to be a nightmare for a few reasons:

1) In the standard 'Aqua Menu' you have menu's like 'Services' which are handled by the system and not by the Application. 2) Apple are specific about their design guides, and menu's aren't mentioned and I'd HIGHLY doubt it apple would like you changing the Aqua layout.

I remember once upon a time coming upon a discussion which mentioned setAppleMenu etc... but that was back in the Tiger (I think) days.

edit you won't be able to get a 'pointer; to it using Documented API's, it's system-driven, not application driven i.e. complying with Aqua.

Personally, I'd remove all of the menuItems which can be changed in a sandboxed app, i.e. in User Land, and add/remove the various menuItems yourself.