Skip to content

Instantly share code, notes, and snippets.

View skela's full-sized avatar

Alek Slater skela

View GitHub Profile
@skela
skela / gist:87cf62944fbfc23cb83c
Created July 9, 2014 07:47
Sample Code for "NSRightMouseDownMask Flag ignored for NSStatusItem sendActionOn"
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
self.statusItem.target = self;
self.statusItem.action = @selector(clickStatusItem:);
[self.statusItem sendActionOn:(NSLeftMouseDownMask|NSRightMouseDownMask)];
NSImage *img = [NSImage imageNamed:@"icon_empty"];
[img setTemplate:YES];
self.statusItem.image = img;
}