检测菜单栏是否隐藏或可见 [英] Detect if menu bar is hidden or visible
本文介绍了检测菜单栏是否隐藏或可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当菜单栏隐藏或可见时,Cocoa中是否有方法接收通知(或类似的东西)?我试图环顾四周,没有找到任何有关这个主题的信息。
Is there a way in Cocoa to receive a notification (or something similar) when the menu bar becomes hidden or visible? I tried looking around and have not found any information on this topic.
感谢
推荐答案
类 NSStatusBarWindow
的对象和
NSWindowDidChangeOcclusionStateNotification
NSWindowWillCloseNotification
当菜单栏显示或隐藏时会收到通知。
to get notified when the menu bar showing or hiding.
这篇关于检测菜单栏是否隐藏或可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文