How can I make a Menu Extra like the Battery Meter in Cocoa? I can make a Status Item, but they are not movable.
+2
A:
The NSMenuExtra
functionality is private API. The best you can do (without delving into Apple's private frameworks and figuring it out yourself) is to use NSStatusItem
.
Dave DeLong
2010-03-22 15:57:10
I miss the days when it wasn't a private API. ;)
mipadi
2010-03-22 15:59:02
Well how can I use Apple's private API's while keeping support for 10.5 and 10.6?
Tristan Seifert
2010-03-22 22:16:29
@Tristan `NSMenuExtra` has been around for years. However, I recommend that you just use a regular `NSStatusItem`.
Dave DeLong
2010-03-22 22:37:52
OK. But how can I move an 'NSStatusItem' around in the Menu Bar like all other Menu Extras?
Tristan Seifert
2010-03-22 23:32:26
@Tristan you can't, because it's an `NSStatusItem`, not an `NSMenuExtra`.
Dave DeLong
2010-03-23 01:26:04