Getting the context of a context menu
Getting the context of a context menu
- Subject: Getting the context of a context menu
- From: Nicko van Someren <email@hidden>
- Date: Thu, 12 Apr 2007 12:50:35 +0100
Cocoa People,
I have an application in which there is a number of UI objects which
require the same context menu. These items get a 'default case'
context menu which just allows the user to get actions like extended
help for the object under the menu. Many of these objects are just
NSButtons and the like, without any class customisation. I have the
common context menu in my .nib file and I can connect it to the
'menu' outlet of each UI item without any problem. The problem that
then arises is that when a menu action is triggered I can't seem to
find out the context of the context menu. The action sender is the
menu item, and I can find it's parent NSMenu, but not from where that
menu was raised.
So, is there some way that I've not found to determine which view
was responsible for raising a context menu, or am I going to have to
subclass every standard UI item I use just so that I can bolt in a -
menuForEvent: method that says { menuContext = self; return [self
menu]; }
Cheers,
Nicko
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden