Re: Dock menus: sender is NSApp
Re: Dock menus: sender is NSApp
- Subject: Re: Dock menus: sender is NSApp
- From: Steven Frank <email@hidden>
- Date: Fri, 26 Oct 2001 16:43:42 -0700
Subject: Dock menus: sender is NSApp
From: "Erik J. Barzeski" <email@hidden>
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."
Erik,
I ran into exactly the same problem.
In my situation, I had a dynamic dock tile menu that consisted of a varying
number of URLs.
What I ended up doing was creating an NSObject subclass called "LinkItem" that
stores the URL, and implements a -launchURL: method.
For each of the dynamic menu items in the dock tile menu then, I set the target
to be the corresponding LinkItem, and to use the -launchURL: selector.
This is about as clean of a solution as I could think of. The big annoyance
is it still requires you to keep track of all the LinkItems, so you can release
them at some later point when the menu changes.
I'd love to hear if there is a better solution,
Steven