Re: Docklet(ing) API & 10.1: Where ????
Re: Docklet(ing) API & 10.1: Where ????
- Subject: Re: Docklet(ing) API & 10.1: Where ????
- From: John Geleynse <email@hidden>
- Date: Tue, 02 Oct 2001 11:24:05 -0700
>
Docklings are not dead, just Apple docklings. What did we have:
>
displays, airport signal and iTunes. They have been replaced by menu
>
extras.
>
Everything is still very private though, so I don't consider Apple wants
>
us to use docklings anymore. Too bad, way too bad. Just another thing
>
they'll dump at the next release.
Correct. Dock Extras, aka Docklings, are no longer being developed by Apple
and the private APIs providing this capability are not guaranteed to
continue working after 10.1. So, despite it's availability in some corners
of the globe, dependence on non-Apple documentation about these APIs is
risky and not recommended.
Dock menus are the Mac OS X 10.1 equivalent of the Mac OS 9 ControlStrip and
main menu bar 3rd party menus.
Allow me to take a moment and go into detail about when these should be
used, and provide you with preliminary information about the APIs
themselves, available in Mac OS X 10.1.
Many of you have been asking for a mechanism to provide global access to
certain features provided by your application. Dock menus are the way to do
this. Please note that the menu extras area of the main menu bar is not
being made available to 3rd party developers at this time and is reserved by
Apple for hardware and networking related items. The Dock is intended to be
the point of entry for 3rd party developers providing this type of global
access functionality.
Essentially what's available to you now is a mechanism for associating and
updating a menu and it's items off of a Dock tile. Whether the Dock tile
belongs to your actual applications or to some faceless background
application is for you to decide.
In Puma 5F, NSApplication has added support for applications to specify the
contents of the application dock menu. This allows an application to add
menu items below the list of windows in the dock menu.
An application can either specify an NSMenu in a nib, or return an NSMenu
from a delegate method.
To specify an NSMenu in a nib, add the nib name to the info.plist, using the
key AppleDockMenu. The nib name should be specified without an extension.
There will be an IB outlet from NSApplication named dockMenu, which should
be connected to the NSMenu in the nib. This menu should be in its own nib
file so that it can be loaded lazily when the dockMenu is requested, rather
than at launch time.
There is also an application delegate method to allow a delegate to specify
the menu dynamically. If the delegate returns non-nil for this menu, it
takes precedence over the dockMenu in the nib. Because this method is
invoked whenever the dockMenu is to be shown, efficiency is important. The
delegate should keep its own internal representation of the dock menu up to
date rather than updating when this method is invoked.
- (NSMenu *)applicationDockMenu:(NSApplication *)sender;
The target and action for each menu item is passed to the dock. On
selection of the menu item, the dock messages the application, which invokes
[NSApp sendAction:selector to:target from:nil].
The current implementation does not yet support adding an image to a
menuItem or changing the menu title based on modifier keys, which are both
features desired in the dockMenu.
I trust this information proves valuable to those of you interested in this
topic.
John Geleynse
User Experience Technology Manager
Apple Worldwide Developer Relations