[Tutor] tkinter arrow event location
alan.gauld at btinternet.com
Fri May 25 00:42:53 CEST 2007
"Teresa Stanton" <tms43 at clearwire.net> wrote
> Using a mouse I could use event.x to find the current location of
> the mouse.
> But if I have a canvas with a gif and I need the current location of
> gif, could I bind the gif to an arrow event to get the feedback of
> where the
> gif is at any given time? If so, can someone show me how?
If you mean an arrow key then yes you can trap keystrokes
and the event driven programming topic of my tutor shows
how to do that in Tkinter.
Once you've detected the keys that you want you should be
able to ask the canvas where the gif currently is located.
Author of the Learn to Program web site
More information about the Tutor