0

I have been looking around for a way to disable the Scale widget of tkinter but I couldn't find one.

I tried a few things but none seem to work:

w = Scale(master, from_=0, to=100)
w.pack()
w.state(statespec=DISABLED)
w.config(state=DISABLED)
w.config(state='disabled')
w.configure(state='disabled')

Does anyone know if it possible or if there is a workaround ? I managed to get it to work fine for Button and Checkbutton widgets.

finefoot
  • 9,914
  • 7
  • 59
  • 102
Sorade
  • 915
  • 1
  • 14
  • 29

1 Answers1

4
w.config(state=DISABLED,takefocus=0)

will make scale widget disabled.It nolonger move

from Tkinter import *

master=Tk()
w = Scale(master, from_=1, to=10)
w.config(state=DISABLED,takefocus=0)
w.pack()

master.mainloop()

Its works perfect for me.

Emmanu
  • 749
  • 3
  • 10
  • 26