The response I got from Jeff Hobbs on this issue is documented below; This fixes the problem.
This is a classic problem with a few widgets in Tk. The widget has to have *focus* to receive key input. What you can do is:
bind Canvas <ButtonPress-1> {+; focus %W}
to force focus always into...
Hmmm... I can think of lot's of reasons to bind keys to a canvas widget. For example, in the drawing program I'm working on right now I have the ability to select objects to be moved or deleted, I'd like to end the selection by hitting the Escape key, once the objects are selected, I might like...
I can't seem to bind key press events to the canvas widget.I used the wish shell for the simplest possible test and wrote the following code from the console.
(bin) 2 % canvas .can -bg black
.can
(bin) 3 % pack .can
(bin) 4 % bind .can <Button-1> {tk_messageBox -message "%W got button press"}...
Hey all,
I'm new to the forum but not new to tcl though I've been away from it for some years. I'm writing a control application that needs to send data to a remote embedded device and using the tkTable widget for the first time as an interface.
I started with a variation of the buttons.tcl...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.