Detect if menu bar is hidden or visible

Is there a way in Cocoa to receive a notification (or something similar) when a menu bar becomes hidden or visible? I tried to look back and did not find any information on this topic.

thanks

+4
source share
2 answers

I solved this with Carbon event handlers.

I registered for the kEventMenuBarHidden and kEventMenuBarShown under the kEventClassMenu class.

+2
source

It is not necessary to monitor notifications (Cocoa) for an object of class NSStatusBarWindow and notifications of the type

to receive a notification when a menu bar is displayed or hidden.

+2
source

All Articles