473,385 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1780
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

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

Similar topics

3
by: srijit | last post by:
Hello, Any idea - why the following code crashes on my Win 98 machine with Python 2.3? Everytime I run this code, I have to reboot my machine. I also have Win32all-157 installed. from Tkinter...
2
by: Paul A. Wilson | last post by:
I'm new to Tkinter programming and am having trouble creating a reusable button bar... I want to be able to feed my class a dictionary of button names and function names, which the class will make....
7
by: SeeBelow | last post by:
Do many people think that wxPython should replace Tkinter? Is this likely to happen? I ask because I have just started learning Tkinter, and I wonder if I should abandon it in favor of...
2
by: codecraig | last post by:
Hi, I was reading through the Tkinter tutorial at http://www.pythonware.com/library/tkinter/introduction/index.htm ...and it mentions that by doing, from Tkinter import * you have access to...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
3
by: dwelch91 | last post by:
I'm trying unsuccessfully to do something in Tk that I though would be easy. After Googling this all day, I think I need some help. I am admittedly very novice with Tk (I started with it...
1
by: yvesd | last post by:
hello i want to intercept tkinter python system events like wm_delete_window and if possible for any window, but the newest code I've produced give me an error : Traceback (most recent call...
3
by: seanacais | last post by:
I'm trying to build an unknown number of repeating gui elements dynamically so I need to store the variables in a list of dictionaries. I understand that Scale "variable" name needs to be a...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
3
by: J-Burns | last post by:
Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. Problem 1: How do I make something appear on 2 separate windows using Tkinter? By...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.