Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to highlight the status bar item programmatically?

I'd like to perform the following:
when I click on the status bar item (NSStatusItem) I want to highlight it (no menu) indefinitely and when the application loses focus I want to stop highlighting it.

Is there any way of doing this? I can't find it, tbh.

like image 399
Pedro Vieira Avatar asked Oct 06 '22 09:10

Pedro Vieira


1 Answers

You can probably do this with a custom view that sends the status item a drawStatusBarBackgroundInRect:withHighlight: message.

I doubt there's any way to do it without a custom view, since, as I mentioned in my comment on the question, keeping the item highlighted when the user doesn't have the mouse down on it looks bad.

like image 101
Peter Hosey Avatar answered Oct 10 '22 01:10

Peter Hosey