Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) makeStatusItemAppear {
- // Menu
- NSMenu* actionMenu = [[NSMenu alloc] init];
- [menu addItemWithTitle:@"Do Something" action:@selector(doSomething) keyEquivalent:nil];
- // Status Item
- NSStatusItem* myStatusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:32];
- [myStatusItem setImage:[NSImage imageWithContentsOfFile:@"blah/path/to/my/icon"]];
- [myStatusItem setMenu:actionMenu];
- }
- -(void) doSomething {
- NSLog(@"Do Something was selected!");
- }
Add Comment
Please, Sign In to add comment