• 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
Re: Accessing default NSTextView contextual menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing default NSTextView contextual menu


  • Subject: Re: Accessing default NSTextView contextual menu
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 22 Mar 2004 10:22:50 -0800

On Mar 20, 2004, at 8:00 AM, Jeremy Dronfield wrote:

I want my application's text view to have two contextual menus - the default plus a special menu for inserting graphic items. To do this I've implemented -menuForEvent: in my text view subclass:

- (NSMenu *)menuForEvent:(NSEvent *)theEvent
{
if ([theEvent modifierFlags] & NSCommandKeyMask)
return myMenu;

return [[NSTextView class] defaultMenu];
}

This works, in so far as it goes. However, [[NSTextView class] defaultMenu] does not contain the Guesses item. Where is it? How can I put it in the menu? If necessary, does anyone know the magic name/tag so I can create one of these items in IB?

Use [super menuForEvent:theEvent] rather than [[NSTextView class] defaultMenu].

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Accessing default NSTextView contextual menu
      • From: Jeremy Dronfield <email@hidden>
References: 
 >Accessing default NSTextView contextual menu (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: NSLocalizedString() doesn't work
  • Next by Date: Re: NSLocalizedString() doesn't work
  • Previous by thread: Accessing default NSTextView contextual menu
  • Next by thread: Re: Accessing default NSTextView contextual menu
  • Index(es):
    • Date
    • Thread