[squeak-dev] Undoable environment ?

Gary Chambers gazzaguru2 at btinternet.com
Tue Apr 29 17:52:22 UTC 2008


Have a look at the Command and CommandHistory clasees. Worked well for our
Report Builder...

Gary.

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org]On Behalf Of
> itsme213
> Sent: 29 April 2008 6:37 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: [squeak-dev] Undoable environment ?
>
>
> 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
>
>
>
>




More information about the Squeak-dev mailing list