• 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
Contextual Menu in NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Contextual Menu in NSTextField


  • Subject: Contextual Menu in NSTextField
  • From: Peter Lennie <email@hidden>
  • Date: Fri, 18 Mar 2005 08:28:01 -0500

My application's window drops a sheet that contains an NSComboBox and an NSTextField (actually several of each). For these views I want to replace the default contextual menus with my own. I have tried several ways to do this, but I cannot get the views reliably to use my menu rather than their default class menus.

1). In the nib file I've connected each view to the menu I want to use. On right-click or control-click my menu is displayed only when the NSComboBox or NSTextField is *disabled* or is not firstResponder. When a view of either class is firstResponder its default class menu appears.

2. I've tried subclassing both NSComboBox and NSTextField and using menuForEvent to return the menu I want, but menuForEvent is called on right-click or control-click only if the view is disabled or is not firstResponder.

I'd be grateful for advice on how to get my contextual menu to be displayed reliably.

Peter Lennie
--
Peter Lennie
Center for Neural Science
New York University
2-4 Washington Place
New York, NY 10003
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Contextual Menu in NSTextField
      • From: stephane sudre <email@hidden>
  • Prev by Date: NSDrawerWindow - using it is okay?
  • Next by Date: Re: Contextual Menu in NSTextField
  • Previous by thread: Re: NSDrawerWindow - using it is okay?
  • Next by thread: Re: Contextual Menu in NSTextField
  • Index(es):
    • Date
    • Thread