In 8.5.1 I get an unexpected difference when using 'list' vs the
quoted form of a color name:
% option add *Background \#d9d9d9 widgetDefault
% entry .foo
.foo
% option add *Background {#d9d9d9} widgetDefault
% entry .bar
.bar
These are both ok. However:
% option add *Background [list #d9d9d9] widgetDefault
% entry .baz
unknown color name "{#d9d9d9}"
This breaks Tix widget classes in 8.5.x which use the #dddddd form to
specify color defaults.
I don't see this in 8.4.x.
Can anyone confirm this? Bug or feature?
R'
The above is simply wrong. The option takes a string, not a list. What
is happening is that Tcl creates a list, converts it to a string, and
passes that to the option command.
You'll notice that with 8.5, the string representation of [list #d9d9d9]
is "{#d9d9d9}", which is perfectly acceptable even though it's different
than 8.4.
> This breaks Tix widget classes in 8.5.x which use the #dddddd form to
> specify color defaults.
#dddddd is fine. Using [list #dddddd] is incorrect usage on the part of
the Tix code and/or your application.
--
Bryan Oakley
http://www.tclscripting.com
Thanks for checking, Bryan.
The code in question is in tixClass.c, static int SetupDefault(...),
#1120ff:
if (Tix_GlobalVarEval(interp, "option add *", cPtr->ClassName,
p->spec, " [list ", p->value, "] widgetDefault",
NULL) != TCL_OK) {
where cPtr->ClassName, p->spec and p->value are const char*.
Tix_GlobalVarEval() simply concatenates all the arguments in a string
and passes this on to Tcl_EvalEx().
This code was there in the initial CVS revision of that file on
Sourceforge... :-/
I guess the correct way would be to set up a proper list of TclObj*
arguments and pass this to Tcl_EvalObjv().
R'
Attached a possible fix to
[ 1864027 ] bogus handling of #color in -defaults class option
on Sourceforge.
R'
There is a new Tix 8.4.3 in CVS that addresses all 8.5 issues as well
as cleaning up other bits.
Jeff
Thanks, Jeff, 8.4.3 has already been grabbed ;-)
R'
...may I draw your attention to tix bug-id 1165876?
This one annoys me every time I build a new tix...
It's a simple typo-fix, 'Background' misspelled 'Bacground' several times.
Applied with a few other fixes.
Jeff