Re: can't access menu?
Re: can't access menu?
- Subject: Re: can't access menu?
- From: Stephane Sudre <email@hidden>
- Date: Tue, 22 Mar 2005 17:42:49 +0100
On 22 mars 05, at 17:32, Luc Vandal wrote:
Hi,
I'm trying to set the menu's title but something strange happens. If I
add a breakpoint in my code, I cannot step over!
- (void)awakeFromNib
{
[[NSApp mainMenu] setTitle:@"Something"];
}
I guess that is not the proper way to access the application menu or
mainMenu hasn't been initialized yet? How/when can I access it? I
tried to search for examples but couldn't find any!
AFAIK, the mainMenu is a NSMenu * which contains NSMenuItem * which
contains NSMenu * and so on...
Would you like to change the title of the Application Menu, you would
need to change the title of the first item in the NSMenu * you're
getting via mainMenu or the NSMenuItem * (I'm not making any choice
between both because if you want to set an Image as the title of the
menu, you need to use the image attribute of the NSMenuItem).
But usually, you change the application menu title via the Info.plist
and its localized siblings.
_______________________________________________
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