|Subject:||trace callback not entered until variable accessed directly|
I noticed that the floor plan canvas demo (floor.pl) is partially broken: typing a valid room number does not cause the room to light up. Hovering over rooms still causes the entry to change though.
I tried experimenting with entry.t and trace.t, and compared behaviors under Perl/Tk and Tcl::pTk to see what might be missing. In Perl/Tk, if the text in an entry widget with a traced textvariable changes (due to the using typing, or programmatically changing it e.g. via $e1->insert()), the trace callback is entered and is responsible for updating the textvariable (by returning a value). But in Tcl::pTk, any changes made by the widget from Tcl code or user interaction will directly update the textvariable without entering the callback; the callback is only entered when the textvariable is read or written from Perl code.
I don't know whether this limitation can be addressed, so maybe it should just be documented. Nor do I know what a good workaround would be. (Since Tkinter can't trace Python variables from Tcl, their approach is to instead use Python classes for traceable Tcl variables. But Tkx doesn't seem to have this limitation?) At the moment I might extend entry.t/trace.t with TODO tests to show how it fails compared to Perl/Tk.