[squeak-dev] Undoable environment ?

John M McIntosh johnmci at smalltalkconsulting.com
Tue Apr 29 21:16:29 UTC 2008


There is an undo system that impara wrote for Sophie. You should  
consider it, we used it extensively to make *most* actions (some VERY  
complex ones) undoable/redoable, this also included
the ability to transparently nest actions, such as having one action  
be a consolidation of multiple sub actions, then treat the one  
container action as an atomic do/undo/redo item.

Say for example do most any textual editing, frame layout, page  
manipulation for 20 mintues, then hold the undo-key down and watch it  
rollback everything.

On Apr 29, 2008, at 10:36 AM, itsme213 wrote:

> I have commands that I would like to make undoable. Is it possible  
> to wrap
> the commands within an "undoable" environment as suggested in
> http://www.ceteva.com/forum/viewtopic.php?t=17
>
> I imagine something like this (but wouldn't know where to start):
>
> A>>setFoo: aFoo
>    Undoable newOn: [ foo := aFoo ]
>
> A>>setBar: aBar
>    Undoable newOn: [ bar := aBar ]
>
> a := A new foo: 0; bar: 0; yourself.
> a setFoo: 5.
> a setBar: 10.
> Undoable undo. "a bar == 0"
> Undoable undo. "a foo == 0"
> Undoable redo. "a foo == 10"
>
> Thanks - Sophie
>
>
>
>

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================





More information about the Squeak-dev mailing list