469,647 Members | 1,821 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Tkinter -> canvas: location of .gif from arrow event

TMS
119 100+
Is there any way of determining the location of a gif grom an arrow event? For example I have a canvas that has a gif that moves and I want the arrow to move the gif. But how does the arrow know where the gif is? There is event.x that tells where the curser is, but how can one determine the location based on a keyboard arrow event?

tms
May 23 '07 #1
4 1488
bartonc
6,596 Expert 4TB
Is there any way of determining the location of a gif grom an arrow event? For example I have a canvas that has a gif that moves and I want the arrow to move the gif. But how does the arrow know where the gif is? There is event.x that tells where the curser is, but how can one determine the location based on a keyboard arrow event?

tms
You'll need to be keeping track of that in your software, somewhere.
I kinda like the idea of a class object that travels around and can alway be asked where on the grid it is. You know, basically:
Expand|Select|Wrap|Line Numbers
  1. class traveler:
  2.     # has a gif for display, etc set up in __init__()
  3.     def GetLocation()
  4.         return self.x, self.y
AS AN EXAMPLE of what I'm thinking of.
May 23 '07 #2
TMS
119 100+
yes yes... I see. That would solve it. Thank you.


tms
May 23 '07 #3
bartonc
6,596 Expert 4TB
yes yes... I see. That would solve it. Thank you.


tms
Sounds like a fun project. I hope that you are enjoying youself and having FUN...
May 23 '07 #4
TMS
119 100+
want the truth? NO, I'm not enjoying it. Its the same project I've been working on. This will be yet another rewrite to get it to work. Earlier this month I was working on the 'pacman' like game, well, I'm still working on it. Can't seem to get it right, and I'm about to give up.


tms
May 23 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by srijit | last post: by
2 posts views Thread by Paul A. Wilson | last post: by
7 posts views Thread by SeeBelow | last post: by
2 posts views Thread by codecraig | last post: by
1 post views Thread by Michael Yanowitz | last post: by
3 posts views Thread by dwelch91 | last post: by
1 post views Thread by yvesd | last post: by
8 posts views Thread by karthikbalaguru | last post: by
3 posts views Thread by J-Burns | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.