views:

188

answers:

1

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
I miss the days when it wasn't a private API. ;)
mipadi
Well how can I use Apple's private API's while keeping support for 10.5 and 10.6?
Tristan Seifert
@Tristan `NSMenuExtra` has been around for years. However, I recommend that you just use a regular `NSStatusItem`.
Dave DeLong
OK. But how can I move an 'NSStatusItem' around in the Menu Bar like all other Menu Extras?
Tristan Seifert
@Tristan you can't, because it's an `NSStatusItem`, not an `NSMenuExtra`.
Dave DeLong