Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将滑块的默认值设置为 100 ?
self.slider = tk.Scale(self.leftFrame, from_=0, to=256, orient=tk.HORIZONTAL, command=updateValue)
cursor=100?
cursor=100
如果这不起作用,您可以随时手动self.slider.set(100).
self.slider.set(100)
使用set方法 1 2 :self.scale.set(100)
set
self.scale.set(100)
使用variable选项 3 4 分配Variable 5 6 7
variable
Variable
self.scale_var = DoubleVar() self.scale_var.set(1) self.scale = tk.Scale(self.leftFrame, from_=0, to=256, orient=tk.HORIZONTAL, command=updateValue, variable=self.scale_var)