As of OS X 10.10 most of NSStatusItem has been deprecated in favour of the button property, which consists of an NSStatusBarButton. It should work like a norma
Here is one more option. Don't set NSStatusItem's action property. Instead add a local event monitor:
[NSEvent addLocalMonitorForEventsMatchingMask:(NSLeftMouseDown | NSRightMouseDown)
handler:^NSEvent *(NSEvent *event) {
if (event.window == self.statusItem.button.window) {
[self itemClicked];
return nil;
}
return event;
}];
Then in -itemClicked highlight the button using highlight: method:
- (void)itemClicked {
[self.statusItem.button highlight:YES];
// Do other stuff
}
To unhighlight just call button's highlight:NO where you need.