Platform:
Win98SE,Wish8.3for Windows.
Description:
It is possible to assign the "-textvariable <name>" option
to an entry widget using a namespace that does not
yet exist.
After the namespace and variable are instantiated, changes to
the variable are not reflected within the text widget.
Subsequent ".entry config -textvariable <name> "
commands do not clear up the problem.
Code snippet:
entry .foo -textvariable fred::foo(wha)
namespace eval fred {
variable foo
}
grid .foo
set fred::foo(wha) "Hey!"
Logged In: YES
user_id=80530
confirmed in 8.4x and HEAD
Looks like it may really be
a bug in variable traces.
Logged In: YES
user_id=80530
It appears that the [entry] code was
written with the assumption that
Tcl_SetVar() always succeeds
in creating a variable, and Tcl_TraceVar
always succeeds in creating a trace.
Those calls do not automatically
create missing namespaces, so they
actually fail when directed to work on
a variable in a namespace that does
not (yet) exist.
The workaround, of course, is to create
namespaces before tying widgets to
them.
An actual fix has to wait until a time
when Tcl might be modified to
create namespaces as they
are needed. See Tcl RFE 582926.
That will not happen in an 8.4.x release.