Re: Reliable way to get application (Apple) menu?
Re: Reliable way to get application (Apple) menu?
- Subject: Re: Reliable way to get application (Apple) menu?
- From: Jiva DeVoe <email@hidden>
- Date: Sat, 12 Mar 2005 18:21:08 -0700
Hope this isn't stating the obvious -
Is there a reason you can't just edit the menu in your nib?
On Mar 12, 2005, at 6:58 AM, Jeremy Dronfield wrote:
Here's a strange omission I stumbled over when trying to remove some
items from my app's application (or, confusingly, "Apple") menu at
launch. First, I tried the obvious ploy of accessing it with:
NSMenu *appMenu = [[[NSApp mainMenu] itemWithTitle:myAppName] submenu];
but that doesn't work, so I tried outputting a description of [NSApp
mainMenu], and found that the item actually has no title:
<MenuItem: 0x34d470 , submenu: 0x342b30 (Apple)>, <<< No title!
<MenuItem: 0x343490 File, submenu: 0x341bf0 (File)>,
<MenuItem: 0x342850 Edit, submenu: 0x343840 (Edit)>,
<MenuItem: 0x3434d0 View, submenu: 0x34c710 (View)>,
So instead I've done:
NSMenu *appMenu = [[[NSApp mainMenu] itemWithTitle:@""] submenu];
which works. But I'll be stuffed if Apple changes this untitled state
in the future. NSApplication has convenience methods for returning
-windowsMenu and -servicesMenu. It also has a -setAppleMenu: method
for changing the application menu, but nothing for accessing it. Why
isn't there an -appleMenu method? Is there a reliable way of accessing
this menu which I've overlooked?
Regards,
-Jeremy
===================================
SkoobySoft, home of viJournal and Skooby Renamer
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
--
Jiva DeVoe
http://www.devoesquared.com
PowerCard - Intuitive Project Management for Mac OS X
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden