The TextUndo Widget

The TextUndo widget is derived from the Text widget, which simply means that it shares all the capabilities of its ancestor. In object-oriented terminology, we say that TextUndo is a subclass of Text (or, Text is a superclass of TextUndo). You'll learn more about this subject in "Creating Custom Widgets in Pure Perl/Tk".

Of course, we expect TextUndo to do something different from Text, and it does: it has unlimited undos and redos so that previous editing operations can be rescinded or redone.

Here are the TextUndo methods above and beyond those available for a Text widget:

TextUndo Virtual Events

The TextUndo widget supports two virtual events, <<Undo>> and <<Redo>>, which invoke the undo and redo methods, respectively. The key sequence Control-Z is bound to <<Undo>>, and Control-Y is bound to <<Redo>>.