Accessing default NSTextView contextual menu
Accessing default NSTextView contextual menu
- Subject: Accessing default NSTextView contextual menu
- From: Jeremy Dronfield <email@hidden>
- Date: Sat, 20 Mar 2004 16:00:31 +0000
The default contextual menu for NSTextView contains Cut, Copy, Paste,
spelling commands and so on. It also has a Guesses item which suggests
alternate spellings for a selected word. This is the item I'm
interested in.
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?
-Jeremy
===================================
SkoobySoft, home of viJournal
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================
_______________________________________________
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.