4

I am using the tkinter Scale widget and I have a scale set up from 0 to 200. When I open it up, I want the slider to be set at 100 (halfway on the trough) not 0. Is there a way for this to be done?

finefoot
  • 9,914
  • 7
  • 59
  • 102
Kian Cross
  • 1,818
  • 2
  • 21
  • 41

1 Answers1

7

You can use the tkinter.Scale.set method to set the scale to whatever value.

Below is a simple script to demonstrate:

from tkinter import Tk, Scale

root = Tk()

w = Scale(root, from_=0, to=200)
w.pack()
w.set(100)  # Set the initial value to 100

root.mainloop()

Example:

enter image description here