If you delegate NSApp to one of your controller objects you could override the method:
- (void)applicationDidBecomeActive
NSNotification *)aNotification
From there you could check to see if any of the windows just received a mouse event (note that this would be trivial but tedious) and, if not, you can be pretty sure that they clicked on the dock icon.
I haven't tried it but it sounds logical.
edit:
After another look at the docs I found this method which might be better:
- (BOOL)applicationShouldHandleReopen
NSApplication *)theApplication hasVisibleWindows
BOOL)flag
This one is called whenever an already open program is double-clicked or whenever someone activates it with the dock. This might work better
/edit
Hope that helps,
Jeff.
[ 04-19-2002: Message edited by: Apocalypse ]