Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 11, 2006, 09:24 PM   #1
mbabauer
macrumors regular
 
Join Date: Feb 2006
Menubar...

I am playing around with Cocoa, and read through a couple of books, but none of them show you how to add an app that runs in the Menubar (Task Tray???) like QuickSilver or Backlight does. Obviously it can be done, but how? A search in the Apple Developers docs for 'menubar' turns up a ton of references to Tk menus, but not really what I need.
mbabauer is offline   0 Reply With Quote
Old Sep 12, 2006, 08:25 AM   #2
mbabauer
Thread Starter
macrumors regular
 
Join Date: Feb 2006
Ok, finally got some leads in the docs and Google. There are actually two places this can be done, as an NSMenuExtras or as a NSStatusItem.

The problem is that apparently NSMenuExtras is a closed API, and NSStatusItem is not guaranteed to be there, as long menu items can overwrite status items if they need space.

There are some workarounds, although I am not clear how they fully work, but they seem to be more like hacks than legit code.

Anyone have any sample code that puts a Status Item up with no menu or window? I am trying to do something similar to QuickSilver (in layout, not functionality) where there is an icon on the right of the menu bar that does something when you click it.
mbabauer is offline   0 Reply With Quote
Old Sep 12, 2006, 09:30 AM   #3
savar
macrumors 68000
 
savar's Avatar
 
Join Date: Jun 2003
Location: District of Columbia
Send a message via AIM to savar
Quote:
Originally Posted by mbabauer
The problem is that apparently NSMenuExtras is a closed API, and NSStatusItem is not guaranteed to be there, as long menu items can overwrite status items if they need space.
I had the same problem several years ago. Back then there were rumors that NSMenuExtras would be made public for 3rd party developers to use. Guesss that never happened.

Using NSStatusItem isn't too bad. I don't have the code anymore, but I think I found it on cocoadevcentral.com.
__________________
Mehce
savar is offline   0 Reply With Quote
Old Sep 24, 2006, 06:06 PM   #4
Fairly
macrumors regular
 
Join Date: Sep 2006
Location: Cambridge UK
Quote:
Originally Posted by mbabauer
I am playing around with Cocoa, and read through a couple of books, but none of them show you how to add an app that runs in the Menubar
That's cos you didn't get the one Cocoa book you need. By Yacktman.
Fairly is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Looking for Textarea in MenuBar DarkoDonnie Mac Applications and Mac App Store 0 Mar 25, 2014 12:03 PM
MenuBar ReArranger 2 fleyne Mac Applications and Mac App Store 0 Dec 3, 2013 11:19 PM
What is this menubar icon? guitarplayer08 Mac Applications and Mac App Store 2 Apr 16, 2013 08:05 PM
OS X Menubar Abuse Simplicated Mac Applications and Mac App Store 12 Jun 27, 2012 08:55 PM
RMBP Menubar juicywaterhouse MacBook Pro 0 Jun 19, 2012 12:11 AM

Forum Jump

All times are GMT -5. The time now is 10:53 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC