• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dynamically changing title of 'Application Menu'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamically changing title of 'Application Menu'


  • Subject: Dynamically changing title of 'Application Menu'
  • From: nick briggs <email@hidden>
  • Date: Wed, 26 Oct 2005 15:20:53 +0100

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?

Thanks

Nick


_______________________________________________ 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
  • Follow-Ups:
    • Re: Dynamically changing title of 'Application Menu'
      • From: Eric Schlegel <email@hidden>
    • Re: Dynamically changing title of 'Application Menu'
      • From: Prachi Gauriar <email@hidden>
  • Prev by Date: Re: Using an NSString as standard input to an NSTask
  • Next by Date: Re: Dynamically changing title of 'Application Menu'
  • Previous by thread: Re: Cell Draw
  • Next by thread: Re: Dynamically changing title of 'Application Menu'
  • Index(es):
    • Date
    • Thread