Re: Accessing default NSTextView contextual menu
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.