[Tkinter-discuss] Disabling widgets [especially ttk.Scale]

Martin B. spooky.ln at tbs-software.com
Mon Jan 17 19:09:47 CET 2011


V Mon, 17 Jan 2011 17:36:52 +0100
"Martin B." <spooky.ln at tbs-software.com> napsáno:

eh i have solution.
must be    state(statespec=('active', '!disabled')

sry


> hi all,
> i have a little problem with setting state of ttk.Scale widget.
> 
> i have a ttk.Checkbutton which operates with ttk.Scale.
> [enabling,disabling]
> 
> <code>
> 
> self.check=BooleanVar()
> button = ttk.Checkbutton(self,
> text='',variable=self.var,command=self._setActive) self.slider =
> ttk.Scale(self)
> 
> def _setActive(self, event=None):
> 	if self.check.get():
> 		self.slider.state(statespec=('active',))
> 	else:
> 		self.slider.state(statespec=('disabled',))
> 
> </code>
> 
> but if i make checkbutton active, slider is disabled :(
> how i make Scale state enabled and disabled if
> self.slider.config(state=NORMAL) is unknown option.
> 
> sry for newbie Q.
> thanks
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
> 



More information about the Tkinter-discuss mailing list