0

I am using a theme in tkinter and it's not allowing me to change state of scale (to control volume of a music player).Before applying the theme it was working fine so i am assuming it's because of the theme.

code :

vol_control = ttk.Scale(l_frame, from_=0, to=100, orient=HORIZONTAL,command=set_vol)
vol_control.set(35)
vol_control.pack(side = LEFT ,padx=15)


vol_control.config(state=DISABLED)

it returns this error when i try to change volume :

in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-state"
stovfl
  • 14,998
  • 7
  • 24
  • 51
  • 1
    Change to `vol_control.state(['disabled'])` – stovfl Feb 23 '19 at 14:46
  • 1
    To clear the disabled flag, use `vol_control.state(['!disabled'])`. Read about [The full list of state flags available to themed widgets](https://tkdocs.com/tutorial/widgets.html#button) – stovfl Feb 24 '19 at 11:18

0 Answers0