Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  2. {
  3. [NSApp activateIgnoringOtherApps:YES];
  4. statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
  5. [statusItem setAction:@selector(showPopOver:)];
  6. [statusItem setImage:[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"]]];
  7. [statusItem setHighlightMode:YES];
  8. }
  9.  
  10. - (IBAction)showPopOver:(id)sender {
  11. popover = [[NSPopover alloc] init];
  12. [popover setContentViewController:popOverController];
  13.  
  14. popover.animates = YES;
  15. popover.delegate = self;
  16.  
  17. [popover showRelativeToRect:[sender bounds]
  18. ofView:sender
  19. preferredEdge:NSMaxYEdge];
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement