Re: Accessing undo stack?
Re: Accessing undo stack?
- Subject: Re: Accessing undo stack?
- From: Magnus Strand <email@hidden>
- Date: Thu, 07 Apr 2005 09:42:15 +0200
Hi Duncan,
I have little experience of this, but perhaps you can use this:
NSUndomanager method:
groupingLevel
|- (|int|)|groupingLevel||
Returns the number of nested undo groups (or redo groups, if Redo was
last invoked) in the current event loop. If 0 is returned, there is no
open undo or redo group.
or
NSDocument method isDocumentEdited
Magnus Strand
Duncan Campbell wrote:
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
---------------------------------------------------------------
A modem is a baudy house.
------------------------------------------------------------------------
_______________________________________________
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
_______________________________________________
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