Search code examples
pythontkinterundoundo-redoredo

Undo and redo features in a Tkinter Text widget?


I need to make both a Control + Z and Shift + Control + Z function in a Tkinter Text widget, so that one may undo and redo things.

Does anyone have an idea on how to do it?


Solution

  • The tkinter Text widget supports undo and redo operations using a stack

    At the following link you can find more information:

    http://www.tkdocs.com/tutorial/text.html#more

    Otherwise you could look at the tkinter or Tk docs for the Text widget and how to create a binding to some keys. The tkinter Text widget function you need is edit_undo.