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 normal button but unfortunately the cell
and setCell
methods in NSStatusButton have also been deprecated. As a result of this I'm struggling to find a way to keep the button highlighted after it's clicked (Normally the button is highlighted on mouse down, and unhighlighted on mouse up. I want to keep it highlighted after mouse up).
Calling [NSStatusButton setHighlighted:]
in its action doesn't work because it seems to unhighlight itself once the mouse is up. On the other hand, using a delay to call it on the next loop i.e. [self performSelector: withDelay:]
causes the highlight to flash in a rather unsightly way. It works, but doesn't look nice.
Setting the button type to NSToggleButton
removes the highlight entirely and instead highlights the template image which was odd.
Those were the only methods I could think of. Is there anyway to override this NSButtonCell mouseUp behaviour?