Re: Dynamically changing title of 'Application Menu'
Re: Dynamically changing title of 'Application Menu'
- Subject: Re: Dynamically changing title of 'Application Menu'
- From: Eric Schlegel <email@hidden>
- Date: Wed, 26 Oct 2005 07:45:06 -0700
On Oct 26, 2005, at 7:20 AM, nick briggs wrote:
Hi
I am trying to dynamically set the title of my apps 'Application
Menu' based on compile flags.
In my app delegates applicationDidFinishLaunching method I perform
the following :
NSMenuItem *item = [[NSApp mainMenu]itemAtIndex:0];
[item setTitle:__CLIENT_NAME__];
Which has no effect. However if I change the code to address the
'File Menu' then the title is updated as expected.
NSMenuItem *item = [[NSApp mainMenu]itemAtIndex:1]; <--
changed index
[item setTitle:__CLIENT_NAME__];
Further more if I call my original code at some arbitrary point
(once the app has finished launching) the menu still fails to update.
How do I override this AppKit behavior?
Essentially, there's no supported way to change your app's name at
runtime. The only supported way is to change the contents of your
Info.plist.
-eric
_______________________________________________
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