View Single Post
  #2 (permalink)  
Old 08-04-2012, 04:15 AM
Will Duquette
Guest
 
Posts: n/a
Default Re: ttk::combobox / why combined option -state?

On Friday, August 3, 2012 3:20:37 PM UTC-7, Torsten wrote:
> Why do some ttk widgets, e.g. combobox, have a combined option "-state normal | readonly | disabled"?
>
> I think it should be more like this: "-state enabled | disabled -readonlytrue | false".
>
>
>
> Torsten


First of all, many Tk widgets have a -state with value normal | disabled. Ttk simply generalizes this; and further, Ttk widget appearance and configuration is scripted (take a look at the style engine some time, and the Tcl code that forms part of the Ttk library), and the -state option is key in this process. You can actually define arbitrarily many states for a particular widget instance, and have it change its appearance (i.e., the bitmap displayed by a ttk::label) depending on the -state. In short, it's a generalpurpose mechanism.
Reply With Quote