Stack of undo and redo actions.
An action consists of one or more callables (no arguments). When the
user does something, you push one or more pairs of functions that undo
and redo it, then seal the action with a label. So, the top of the stack
should be a seal (label), and "undo" reverses all actions
between the top seal and the next one down.
|
__init__(self,
depth=None)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
clear(self)
Resets the stack so there are no undo or redo actions. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
push_undo(self,
undo,
redo)
Adds undo() and redo() to the stack. |
source code
|
|
|
seal_undo(self,
lbl)
Groups the preceding calls to push_undo(), sets undo_lbl, clears the
redo stack. |
source code
|
|
|
|
|
|
|
undo(self,
single_item=False)
Calls all unsealed undo functions, and all between the last two
seal_undo()s, and transfers them to the redo stack. |
source code
|
|
|
redo(self)
Does whatever was undone by undo(), transfers it back to the undo
stack. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|