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

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.


  • Follow-Ups:
    • Re: Accessing default NSTextView contextual menu
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Programmatically Create Login Item
  • Next by Date: Re: memory management question
  • Previous by thread: Re: Programmatically Create Login Item
  • Next by thread: Re: Accessing default NSTextView contextual menu
  • Index(es):
    • Date
    • Thread