Re: Document still modified after last Undo
Re: Document still modified after last Undo
- Subject: Re: Document still modified after last Undo
- From: email@hidden
- Date: Thu, 27 Apr 2006 22:59:06 -0700
David Catmull wrote:
In my drawing app, I'm working on dragging objects with the mouse.
It's working except for one small problem: if I open a document,
move a graphic, and then undo, the document remains "modified" even
though the Undo command is left properly disabled.
Other undoable actions (which are done through bindings) don't have
this problem: the document reverts to being unmodified after the
last change is undone. The only difference I can think of is that
for my dragging, I bracket the change with begin/endUndoGrouping in
case multiple objects are selected. Could this be related, or am I
missing something else?
Yes this is most likely the case. I've removed all of my groupings
(that I thought I needed) and all of this behavior stopped in my app,
which is exactly what your describing.
My problem was that I did not fully or correctly understand how
coredata/KeyValueSystem operated with undo, and so I unnecessarily
used undo groupings.
I was surprised to find that with changes to multiple objects
through bindings, undo grouping seems to be handled automatically.
How does it find the undo manager?
Its because at the end of the runloop is when an undo finishes its
"recording." Therefore, if you change even a thousand objects in/
from a single thread and within a single event in the run loop, then
its going to have exactly one undo. (Someone please correct me if I'm
wrong)
Andre
Andre
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