Feature or enhancement
The Tk text widget supports the pathName edit canundo and pathName edit canredo subcommands, which report whether the undo and redo stacks are non-empty. tkinter currently wraps edit modified, edit redo, edit reset, edit separator and edit undo, but not edit canundo/edit canredo. They are only reachable through the generic, undocumented Text.edit() passthrough.
I propose adding two convenience methods to tkinter.Text:
edit_canundo() — return True if undo is possible (the undo stack is not empty), False otherwise.
edit_canredo() — return True if redo is possible (the redo stack is not empty), False otherwise.
Both return a proper bool.
Links to previous discussion
This is one of a few Tk text subcommands not yet wrapped by tkinter; sync/pendingsync are tracked separately.
Linked PRs
Feature or enhancement
The Tk text widget supports the
pathName edit canundoandpathName edit canredosubcommands, which report whether the undo and redo stacks are non-empty. tkinter currently wrapsedit modified,edit redo,edit reset,edit separatorandedit undo, but notedit canundo/edit canredo. They are only reachable through the generic, undocumentedText.edit()passthrough.I propose adding two convenience methods to
tkinter.Text:edit_canundo()— returnTrueif undo is possible (the undo stack is not empty),Falseotherwise.edit_canredo()— returnTrueif redo is possible (the redo stack is not empty),Falseotherwise.Both return a proper
bool.Links to previous discussion
This is one of a few Tk text subcommands not yet wrapped by tkinter;
sync/pendingsyncare tracked separately.Linked PRs