• 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: Custom NSTextView and undo/redos
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSTextView and undo/redos


  • Subject: Re: Custom NSTextView and undo/redos
  • From: Keary Suska <email@hidden>
  • Date: Tue, 04 Apr 2006 16:28:54 -0700

on 4/4/06 2:54 PM, email@hidden purportedly said:

> In my document-based text editor, the document windows has a custom
> NSScrollView. I created a protocol for NSTextViewClass to manage cut/
> copy/paste and
> shouldChangeTextInRange:affectedCharRange:replacementString:
> operations in my own way and these operations work fine. But
> unfortunately, the undo/redo menu items are disabled. I tried also to
> replace the protocol with a custom class , inherited from NSTextView
> class and to pose this class as NSTextView class. The four methods I
> designed still work fine, but cannot get undo/redo either. Thanks for
> Help.

I can't say why you are having the particular issues--I know sometimes you
have to override certain methods when subclassing certain cocoa objects.
Including - (BOOL)validateMenuItem:(NSMenuItem *) in your custom class
should do the trick. You may also want to call the same method on the super
class for all other items, just in case.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

 _______________________________________________
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

References: 
 >Custom NSTextView and undo/redos (From: Denis Delbecq <email@hidden>)

  • Prev by Date: Custom NSTextView and undo/redos
  • Next by Date: Re: Custom NSTextView and undo/redos
  • Previous by thread: Custom NSTextView and undo/redos
  • Next by thread: Re: Custom NSTextView and undo/redos
  • Index(es):
    • Date
    • Thread