The text
widget supports a full undo/redo functionality. You just have to turn it on; since not all uses of text
want that sort of thing, it's off by default. To turn it on, you just need to set the boolean -undo
widget option to true. It's as simple as that (though the way you write it might be a little different in languages other than Tcl, e.g., it's undo
in Tkinter).
However, PerlTk seems to make a confused mess of it all. For some reason, the Tk::Text
widget doesn't support undo/redo (Why? The machinery is in there, poking through.) and the Tk::TextUndo
widget doesn't have the redo capability exposed (Why on earth would that be omitted?) These are all limitations in PerlTk, not Tk itself. In that case, your best bet might be the Tk::Text::SuperText
class, though to me that's very odd as it's just doing what I consider to be core Tk functionality.
Or maybe it's just the CPAN documentation that's out of date.