开发者

How to detect if NSStatusItem is displayed in status bar?

My Mac OS X application has a NSStatusItem.

It works fine, however, I just discovered that apparently if there are too many items in the top menu/status bar (for instance, if an app has 开发者_如何学Pythonlong menus, there are too many icons, etc.), my status item gets hidden by the system.

How can I detect this in my application, so that I can do something about it?

Thanks


On page 18 of the 26 July 2011 edition of the Mac OS X Human Interface Guidelines (where status items are referred to as "menu bar extras"), it is stated:

Note: If there isn’t enough room to display all of the active app’s menus, Mac OS X can omit some menu bar extras. If there is still insufficient room to display all menus, some of the app’s menus may be omitted, starting with the rightmost menu.

So to answer your question, "(Can I) do something about it?", the answer is: No. You have to think of the menu bar extra as the 'extra' that it is called, an additional convenience. If you really want to use this UI element, you do so by providing one that does not contain commands critical to the user's control of your application. Rather, you should provide those that can be accessed from elsewhere in your application.


This question is pretty much a duplicate of this. There is a very disingenuous solution described in the link for solving your problem though it requires more work than you'd expect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜