Hi guys, I’m looking for a little help with an NSStatusItem app. My handler for the NSStatusItem doesn’t open a menu. Instead, I have it set up to open a custom window. This is no problem but I’d like the NSStatusItem icon to stay highlighted after it’s clicked and while the window remains open. I am using MacOSLib.
Until I read that, I was going to suggest using a custom view, this way you can draw the selected background when you want. However there is no guarantee that it’s going to work in a future version.
[quote]/*
Custom views should not be set on a status item.
The button property with a template image will allow proper styling of the status item in various states and contexts and should be used instead.
*/[/quote]
(My headers are out of date and NSStatusBarButton only shows one boolean property.)
This SO post has an idea how to work with -button for a similar keeping-it-highlighted situation
Yeah, it seems to be mostly passed on to NSStatusBarButton, as Will says. It’s only deprecated though, a quick test shows the old NSStatusItem functionality is fine for now in El Cap.
[quote=203857:@Will Shank]This SO post has an idea how to work with -button for a similar keeping-it-highlighted situation
I can confirm that with PB3 it does still work, but that doesn’t mean that come GM it will. With Yosemite Apple changed a couple of things with the GM, okay they removed some system icons that my app was using! Wasn’t impressed as my app was working during the DPs but then I get a bunch of crash reports once GM ships.