Next / Previous / Contents

24.7. The Text widget undo/redo stack

The Text widget has a built-in mechanism that allows you to implement undo and redo operations that can cancel or reinstate changes to the text within the widget.

Here is how the undo/redo stack works:

For the methods used to implement the undo/redo stack, see the .edit_redo, .edit_reset, .edit_separator, and .edit_undo methods in Section 24.8, “Methods on Text widgets”. The undo mechanism is not enabled by default; you must set the undo option in the widget.