Text-文本撤销

 1 #撤销操作
 2 from tkinter import *
 3 master = Tk()
 4 #打开undo按钮
 5 text=Text(master,width=30,height=5,undo=True)
 6 text.pack()
 7 text.insert(INSERT,'I love coding')
 8 
 9 def show():
10     text.edit_undo()
11 b = Button(master,text='撤销',command=show)
12 b.pack()
13 
14 mainloop()

 

posted @ 2017-04-27 19:39  道高一尺  阅读(609)  评论(0编辑  收藏  举报