I was just wondering if there was any possible way to bind a click event to a canvas in Tkinter.
I would like to be able to click anywhere on a canvas and have an object move to it. I am able to make the motion, yet I have not found a way to bind a click event on a canvas.
Taken straight from an example from an Effbot tutorial on events.
Update: The example above will not work for 'key' events if the window/frame contains a widget like a Tkinter.Entry widget that has keyboard focus. Putting:
in the 'callback' function would give the canvas widget keyboard focus and would cause subsequent keyboard events to invoke the 'key' function (until some other widget takes keyboard focus).