python - 撤消和重做 Tkinter 文本小部件中的功能?

标签 python tkinter undo undo-redo redo

我需要制作 Control + ZShift + Control + Z Tkinter Text 小部件中的功能,以便可以撤消和重做事情。

有人知道怎么做吗?

最佳答案

Tkinter 文本小部件已经支持使用 Control + Z 撤消和使用 Shift + Control + Z 重做,但您必须使用 undo=True 在小部件上启用它们。您可能还想使用 autoseparators=Truemaxundo=-1。请参阅此链接 https://www.tcl.tk/man/tcl8.5/TkCmd/text.htm#M65 .

关于python - 撤消和重做 Tkinter 文本小部件中的功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3169344/

相关文章:

wpf - 撤消日记 : focusing the control being undone

python - 根据特定条件创建新行并迭代 pandas 中的列表

python - 匹配多个数据帧之间的子字符串并在单独的列中求和加权值

python - 如果在函数中创建,为什么 Tkinter 图像不显示?

mesh - 如何撤消 gmsh 中的操作

python - 对内存中的 "transaction"使用 pickle 吗?

Python:基于交集的简单列表合并

python - 如何查找 numpy 数组是否包含沿第三维的向量?

python - 如何在启动 Tkinter 应用程序时隐藏控制台窗口,但在按下 GUI 按钮运行 python 脚本时重新打开它?

python - 如何在网格中显示 csv 文件?