Hi Christian,
On Sat, 3 Nov 2012, Christian Gollwitzer wrote:
> Am 03.11.12 13:08, schrieb Gerhard Reithofer:
> > Hi TLCers,
> > from an example some time ago in this newsgroup I found some strange
> > behavior:
...
> > Throws an error, if there is no text in the entry:
> > can't read "yourtext": no such variable
>
> I don't know whether it is intended, but the reason is simply that ttk::entry
> does not touch the variable until you first use it. As it has not been set in
> the code, it is unset until you first put something into the box. In order to
> fix this, put
>
> set yourtext {}
>
> into the code.
ok, is this a workaround or solution?
If it is not intended, then it's just a workaround ;)
> For an entry, this might not be very useful. However, radiobuttons and
> checkboxes use unset variables for tri-state information. Unfortunately, there
> is a bug in the X11 versions of Tk that the third state is not displayed
> correctly. On Win&Aqua, however, this displays a checkbutton with an initial
> "undecided" third state:
>
> pack [ttk::checkbutton .c -text "Undecided" -variable notinitialized]
This is another "problem", isn't it?
Ttk checkbox doesn't have -tristate option, Tk has it.
Therefore I would call the Win&Aqua behavior as bug.
And to increase the confusion completely:
Test on Windows XP, Tcl8.6b1.2
package require Tk
pack [checkbutton .c -variable var -tristatevalue 2]
set var 2
After creation the state is "unchecked", when setting var to the
tristate value 2 the checkbox is changed to "checked", not tristate!
On 8.6b3 the same works on Linux.
Q: 3 bugs to file?