Building a menu extra that implements all the features seen in system menu extras

烂漫一生 提交于 2019-12-24 16:22:28

问题


I would like to build a menu extra with all the features seen in the system menu extras, but without to use the private class implemented by Apple.
Is that possible, or many of the features seen in the system menu extras depends from SystemUIServer?


回答1:


If it were possible there would be a whole lot of them on the market because nobody really likes the anemic NSStatusItem API.




回答2:


It is not possible.
The features present in the system menu extras are implemented through SystemUIServer; a class that would implement those features should interact with SystemUIServer, which means that if SystemUIServer code is changed, also the class should be changed. Rather than creating a new class, it would be better to use the same class used by Apple, which is not documented (and that could be changed from Apple in any moment).



来源:https://stackoverflow.com/questions/1921996/building-a-menu-extra-that-implements-all-the-features-seen-in-system-menu-extra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!