Re: NSUndoManager - clearing a single 'redo'
Re: NSUndoManager - clearing a single 'redo'
- Subject: Re: NSUndoManager - clearing a single 'redo'
- From: Jérôme Laurens <email@hidden>
- Date: Mon, 9 Dec 2002 09:17:54 +0100
Le lundi, 9 dic 2002, ` 02:59 Europe/Zurich, Bruce Veazie a icrit :
Is there a way to prevent an 'undo' from being transferred to the
'redo' stack or to clear just the last redo?
I'm developing a document-based OpenGL modelling app. When an object
is loaded from a file I register an 'undo load object' which deletes
the object - to permit the user to delete an object just loaded if
it's the wrong file, etc. When Cmd-z is used to undo the load, i.e.,
delete the erroneously loaded object, a 'Redo load object' gets
stacked. I'd prefer not to have that 'redo' on the stack.
maybe you should change your code design
1 have a _deleteObject: low level model method
2 have a deleteObject: that wraps the previous to add undo support
(undo and redo...)
3 in your loadObject: method,implement undo support with the lower
level _deletObject: such that this is a one way undo only.
Of course you can play with setting ON or OFF undo registering
according to some appropriate flag, but this seems to weaken the code.
Anyone know of a way to clear that single 'redo load' when the 'undo
load' is invoked?
the answer is: don't register it...
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.