undo and redo ?

Robert Brewer fumanchu at amor.org
Fri Jan 2 13:31:19 EST 2004


Somebody asked:
> > anyone can inspires me how we can
> > achieve undo and redo function ?

Diez B. Roggisch replied:
> When working with a MVC-approach, the actions you the user 
> can invoke on the
> model could be created as objects that know how to undo/invert their
> effects. Then you store a list of these actions and 
> performing undo takes
> the last action and apply its inverted action to your model. 


An excellent point of inspiration can be found via the GoF:
http://www.amazon.com/exec/obidos/ASIN/0201633612

Synopsis/discussion at:
http://c2.com/cgi/wiki?CommandPattern


FuManChu




More information about the Python-list mailing list