|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- from tkinter import *
- root = Tk()0
- text = Text(root, width=30, height=5, autoseparators=False, undo=True, maxundo=10)
- text.grid(row=1, column=1)
- text.insert(INSERT,'l love fishc.com')
- def fenge():
- text.edit_separator()
- text.bind('<Key>',fenge)
- def che():
- text.edit_undo()
- def hui():
- text.edit_redo()
- Button(root,text='撤销',command=che).grid(row=2, column=1,sticky=W,padx=10,pady=5)
- Button(root,text='恢复',command=hui).grid(row=2, column=2,sticky=E,padx=10,pady=5)
- mainloop()
复制代码
怎么让两个按钮边近
- from tkinter import *
- root = Tk()
- text = Text(root, width=30, height=5, autoseparators=False, undo=True, maxundo=10)
- text.grid(row=1, columnspan=2)
- text.insert(INSERT,'l love fishc.com')
- def fenge():
- text.edit_separator()
- text.bind('<Key>',fenge)
- def che():
- text.edit_undo()
- def hui():
- text.edit_redo()
- Button(root,text='撤销',command=che).grid(row=2, column=0,sticky=W,padx=40,pady=5)
- Button(root,text='恢复',command=hui).grid(row=2, column=1,sticky=E,padx=40,pady=5)
- mainloop()
复制代码
|
-
|