Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Building Menubar and Context Menu Plugins

Building Menubar and Context Menu Plugins
Thread Tools
Fresh-Faced Recruit
Join Date: Nov 1999
Location: San Jose, CA, USA
Status: Offline
Reply With Quote
Mar 9, 2003, 01:35 PM
 
I'd like to build menubar and context menu plugins for the Finder in MacOS 10.2 or later. I've seen plenty of them out there (Stuffit, APE, MenuPop, etc) so I know it must be possible to figure it out or reverse engineer Apple's *.plugin bundles.

According to the Aqua Human Interface Guidelines at Apple's dev site:

"Don't create your own menu bar status items. Use the Dock menu functions to open a menu from your application?s icon in the Dock."

So I doubt Apple is going to help me out. Anyone else have any information to help make my life much easier developing menu bar status items and Finder context menu plugins?

Thanks.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 9, 2003, 02:35 PM
 
Apple has an example of creating a Contextual Menu Plugin in their sample code section.

As for creating a status item, the NSStatusItem API is available for anyone to see. If you want it to be a Menu Extra, though, you'll have to class-dump SystemUIServer, and then your users will still need Unsanity's Menu Extra Enabler.
(Last edited by Chuckit; Mar 9, 2003 at 06:42 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
jobim  (op)
Fresh-Faced Recruit
Join Date: Nov 1999
Location: San Jose, CA, USA
Status: Offline
Reply With Quote
Mar 9, 2003, 05:57 PM
 
Apple has an example of creating a Contextual Menu Plugin in their sample code section.
Ah, they Carbonized CMM. Thought Apple might have developed a Cocoa equivalent. Guess not.

As for creating a status item, the NSStatusItem API is available for anyone to see. If you want it to be a Menu Extra, though, you'll have to class-dump AppKit, and then your users will still need Unsanity's Menu Extra Enabler. [/B]
Looks like using NSStatusItem and having a deamon around to handle the actions will be what I need. Glad they have NSStatusItem in Java since most of my underlying code is Java, for cross platform reasons, but I'm targeting my UI as MacOS X sexy. I guess I'll find out how well the Java version works. Since what I need is MacOS 10.2 and beyond, I don't see a reason for Menu Extra Enabler, unless I'm missing something.

Found some useful NSStatusItem tips here:

NSStatusItem Tutorial at Cocoa Dev Central

Again, thanks for all the help.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 9, 2003, 06:53 PM
 
Just wanted to point out that it's SystemUIServer, not AppKit, that you need to class-dump for the Menu Extra interface. Don't know why I said AppKit. Anyway, as long as I'm here...

Originally posted by jobim:
Since what I need is MacOS 10.2 and beyond, I don't see a reason for Menu Extra Enabler, unless I'm missing something.
Well, Menu Extra Enabler only has an affect on 10.2 and up. As of 10.2, Apple has put a check in SystemUIServer to make sure that only Apple-created plugins would work. Menu Extra Enabler patches the verification function to always return YES. But since you're using an NSStatusItem, the restriction on Menu Extras won't affect you.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Banned
Join Date: Apr 2002
Location: -
Status: Offline
Reply With Quote
Mar 9, 2003, 10:12 PM
 
Originally posted by jobim:
Ah, they Carbonized CMM. Thought Apple might have developed a Cocoa equivalent. Guess not.



Looks like using NSStatusItem and having a deamon around to handle the actions will be what I need. Glad they have NSStatusItem in Java since most of my underlying code is Java, for cross platform reasons, but I'm targeting my UI as MacOS X sexy. I guess I'll find out how well the Java version works. Since what I need is MacOS 10.2 and beyond, I don't see a reason for Menu Extra Enabler, unless I'm missing something.

Found some useful NSStatusItem tips here:

NSStatusItem Tutorial at Cocoa Dev Central

Again, thanks for all the help.
An app with LSUIElement set to "1" should do the trick. good luck.
     
Forum Regular
Join Date: Jun 2001
Location: Savoy, IL USA
Status: Offline
Reply With Quote
Mar 11, 2003, 11:45 AM
 
IMO, I would stick to the NSStatusItem API, since the Menu Extra hidden API is a moving target. Menu Extra Enabler is not guarenteed to work when 10.3 is released, and I don't know if you want to have to wait for them to fix MEE for your app to work. There are some niceties that don't work when you use the NSStatusItem API, like command-moving the status item, but I think that having an app that will work in future OS versions without resorting to someone else's hackery is more valuable. Also, by now most people understand that 3rd party status bar items don't behave like Menu Extras, anyway, so this will reduce the confusion.

[rant]I do, however, wish that Apple would unify the functionality of these two separate APIs. Both of our major 'productivity' apps use status bar items, because they aren't 'normal' apps, and it really sucks that they don't behave like Apple's menu extras. It really reflects badly on the 3rd party developers when their stuff doesn't work like Apple's own (since it looks like we're doing something wrong), and that's just not Developer FriendlyTM! [/rant]

Also, they need to work out the SystemUIServer and Dock synchronization bugs (well, and Dockling initialization bug), but that's a whole different thread...

[Edit: How come the unicode tm (option-2) doesn't work?]
Software Architect, CodeTek Studios, Inc.

12" AlBook 867 (Combo drive) 640 MB/40 GB (work development machine) -- TiBook 400MHz/384MB/10GB (home machine)
CodeTek VirtualDesktop Pro: Power multitasking! -- DockExtender: Powerful, efficient launcher for Apps, Docs and everything else!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:52 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2