Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace callback not entered when variable accessed from Tcl #22

Open
chrstphrchvz opened this issue Apr 7, 2021 · 0 comments
Open

trace callback not entered when variable accessed from Tcl #22

chrstphrchvz opened this issue Apr 7, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed Perl/Tk compatibility

Comments

@chrstphrchvz
Copy link
Owner

From https://rt.cpan.org/Ticket/Display.html?id=128677:

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 user 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.

A TODO test was added to t/trace.t in 1.08_02 for this issue: 838f409

I am still not sure how this can be addressed. I would think Tcl's trace add variable … is needed, but also that this approach would require rewriting Tcl::pTk::Trace and Tcl::pTk::Tie::Watch (which seem copied as-is from Perl/Tk).

@chrstphrchvz chrstphrchvz added bug Something isn't working help wanted Extra attention is needed labels Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Perl/Tk compatibility
Projects
None yet
Development

No branches or pull requests

1 participant