NSStatusBar *bar = [NSStatusBar systemStatusBar];
NSStatusItem * theItem = [bar statusItemWithLength:NSVariableStatusItemLength];
[theItem retain];
[theItem setTitle:NSLocalizedString(@"Menu Title", @"")];
[theItem setHighlightMode:YES];
[theItem setToolTip:@"Menu ToolTip"];
[theItem setEnabled:YES];
[theItem sendActionOn:NSLeftMouseDownMask];
[theItem setTarget:self];
[theItem setAction:@selector(showInterface:)];
[theItem setMenu:nil];
And boom, I now have a status item called "Menu Title" on the top right that is always displayed. Awesome!
No comments:
Post a Comment