• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting the context of a context menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Getting the context of a context menu
      • From: Nicko van Someren <email@hidden>
    • Re: Getting the context of a context menu
      • From: Carmin Politano <email@hidden>
  • Prev by Date: Re: Translation of text
  • Next by Date: Re: Getting the context of a context menu
  • Previous by thread: Re: Translation of text
  • Next by thread: Re: Getting the context of a context menu
  • Index(es):
    • Date
    • Thread