Creating a Menu Bar item on the right side.

Discussion in 'Mac Programming' started by Garrett, Jul 21, 2008.

  1. Garrett macrumors regular

    Joined:
    Apr 4, 2007
    #1
    [​IMG]
    How would you start to do this? Do you need to create a bundle? I have searched for NSMenu's in the Menu Bar and nothing has came up for your own. :eek: Anything in the right direction would be nice!
     
  2. Manty macrumors member

    Joined:
    Mar 18, 2008
    Location:
    Lisbon, Portugal
    #2
    If you mean the status bar icon you must add:
    Code:
    <key>LSUIElement</key>
    <true/>
    to your Info.plist file to make it "dockless", then just add a status item programmatically:

    Code:
    statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:30];
    [statusItem setTarget:self];
    [statusItem setAction:@selector(showMenu)];
    [statusItem setHighlightMode:YES];
    [self setStatusItem:statusItem withValue:@"MenuTitle" andImage:nil];
    [statusItem retain];
    Hope that helps,
    Manty
     
  3. Garrett thread starter macrumors regular

    Joined:
    Apr 4, 2007

Share This Page