问题
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