Re: Dock menus: sender is NSApp
Re: Dock menus: sender is NSApp
- Subject: Re: Dock menus: sender is NSApp
- From: Brian Webster <email@hidden>
- Date: Sat, 27 Oct 2001 00:17:36 -0500
On Friday, October 26, 2001, at 06:28 PM, cocoa-dev-
email@hidden wrote:
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...
Yeah, it's pretty limiting, I must say. But I know that Apple's
definitely aware of the problem and we will see it fixed. That
doesn't mean an extra couple bug reports on it would hurt,
though. :)
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."
Well, I did make a workaround for it, and I'd say it's rather
"interesting". I gave each menu item a different action, the
same name with a number tacked on to the end of it (doStuff1:,
doStuff2:, etc.) I then implemented forwardInvocation: (and
methodSignatureForSelector: of course) to pick the number off of
the end of the selector so I could tell which menu item had been
chosen. Very very ugly... but it worked!
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster