27 Dec 2009
Creating a Menu Bar Item
On my MacBook Pro, I have a lot of items in the menu bar: Tweetie, LittleSnapper, Jing, Evernote, BusySync, MobileMe, along with the standard set. Recently, when I needed to make my own, I started wondering what they are. Actual apps or app components? Activity Monitor confirmed that most are separate applications, although Tweetie's is just a component. Good, so how do I make one?
All I had to do is add a single row to Info.plist: set LSUIElement to true. The other code is boilerplate, creating a controller in Xcode and hooking up some outlets in Interface Builder. I created a quick sample project on Google Code under MenuBarItem (screenshot below). Thanks again to Glyphish for an awesome set of free icons, including the pictured coffee mug.