我的代码如下:
var = DoubleVar()
scale = Scale(root, variable = var, command=self.scalfunc, from_=4, to=40, width=40,tickinterval=0,orient=VERTICAL,length=300,highlightthickness=0, background='#333333', fg='grey', troughcolor='#333333', activebackground='#1065BF')
scale.pack(anchor=CENTER)
scale.place(x=SCwidth/1.2, y=SCheight/15)
我有按钮UNDO
和另一个按钮REDO
我想当我点击该按钮时,我会使滑块值撤消或重做
如果我理解正确,您可以将滑块的所有位置存储在一个列表中,并使用索引指针来操纵它在列表中的位置
当用户更改滑块的位置时
当用户点击undo时
重做
此代码允许使用控制键更改
tkinter.tk
窗口的master
颜色对
Scale
的更改使用名为计数器的索引int
存储在名为内存的列表中Control-z
将撤消Control-Z
将重做Control-x
将清除内存根据您的需要修改它应该不会太困难
相关问题 更多 >
编程相关推荐