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

Re: NSTextView undo/redo question


  • Subject: Re: NSTextView undo/redo question
  • From: Brian Webster <email@hidden>
  • Date: Sun, 19 Aug 2001 13:43:38 -0500

On Sunday, August 19, 2001, at 11:17 AM, cocoa-dev-
email@hidden wrote:

NSTextView implements a method, setAllowsUndo:, which turns a text view's
built-in undo/redo behavior on and off.

My question: what is the target of the actions that are registered by
NSTextView's undo/redo routines?

Well, there are probably going to multiple targets, since the undo support does things such as reselecting previous selections as well as inserting and deleting text and attributes. So, the text view, the text storage, and perhaps the layout manager could all potentially register various undo actions (I doubt the text container(s) would, though). Not to mention any number of private objects lurking inside the Cocoa text system. :-|

You might instead try implementing the undoManagerForTextView: method in your text view's delegate so you can keep a separate undo manager for the text view. That way, you could just clear all the actions in the text view's undo manager and keep all the custom actions in your window's undo manager. You'd just have to make sure to send an undo message to both managers when the user selects Undo.

--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster


  • Follow-Ups:
    • Re: NSTextView undo/redo question
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: WTF? How can this work?
  • Next by Date: in-memory files?
  • Previous by thread: NSTextView undo/redo question
  • Next by thread: Re: NSTextView undo/redo question
  • Index(es):
    • Date
    • Thread