• 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: Accessing undo stack?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing undo stack?


  • Subject: Re: Accessing undo stack?
  • From: Serge Meynard <email@hidden>
  • Date: Thu, 07 Apr 2005 11:36:14 -0400

If you're using a document-based approach, then you should simply call NSDocument's updateChangeCount: method, with the constants NSChangeDone and NSChangeUndone. If you're not, then I suggest you replace your edited flag with an edit count, and code your own updateChangeCount: method to manage it.

Serge

Hi folks.

I have an NSTextView that i am using as a text-editor. When the contents are changed, i set a flag to say that Edited=True, and use [NSWindow setDocumentEdited:hasChanged] to notify the window that an edit has happened (sets the little dot in the red top-left button).

Now if I do apple+z to undo, then my text-editor is now not edited - however I am not sure how to check this - I am thinking it may be possible to look at the Undo-stack, and if nothing is on it then I can assume that an edit has not happened? Is this a good approach to take? Can anyone offer any advice?

Cheers.

---------------------------------------------------------------
Duncan Campbell
http://www.duncanandsarah.com/duncan
---------------------------------------------------------------

_______________________________________________ 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: 
 >Accessing undo stack? (From: Duncan Campbell <email@hidden>)
 >Re: Accessing undo stack? (From: Magnus Strand <email@hidden>)

  • Prev by Date: Re: NSTypesetter and NSLineSweepDirection
  • Next by Date: Re: GNU GPL Controller Layer for Sets
  • Previous by thread: Re: Accessing undo stack?
  • Next by thread: Memory leak in simple code?
  • Index(es):
    • Date
    • Thread