Dock menus: sender is NSApp
Dock menus: sender is NSApp
- Subject: Dock menus: sender is NSApp
- From: "Erik J. Barzeski" <email@hidden>
- Date: Fri, 26 Oct 2001 16:07:36 -0400
Hi,
I'm glad that I can easily imlement a Dock Menu in Cocoa with:
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
Unfortunately, there's a DRASTIC oversight in the current Dock Menu
implementation.
My implementation of the method above creates x menu items. Why x items?
Because I have one menu item for each file in a particular directory.
Of course, each of these menu items is given the same action (and a
different tag). I assigned their selector using the below method:
[thisMenu insertItemWithTitle:itemName action:mySelector keyEquivalent:@""
atIndex:i]
Of course, big freaking problem: there's absolutely no way to figure out
which menu item was selected, huh? Ooops. I'd call that a bug... Or at the
very least a really big oversight...
Any way, if you've got a work-around, I'd love to hear it, because the ones
I've heard so far are pretty, uhh, "interesting."
--
Best wishes,
Erik J. Barzeski
Imagination is more important than knowledge - Albert Einstein
*******************************************************************
Email: erik@(anything below)
AIM: iacas ICQ: 8186546
http://barzeski.com/ http://weims.net/
http://techstra.net/ http://cocoadevcentral.com/
http://soundsetcentral.com/ http://applescriptcentral.com/
*******************************************************************