Cursor Position.

Diez B. Roggisch deets at nospam.web.de
Wed Nov 9 09:57:43 CET 2005


Samantha wrote:
> I will be using Tkinter. All I need is a way to get the X,Y position from a 
> mouse click. I am trying to have an image loaded to click on, but that seems 
> to be a problem. So if I can just get the position from the screen of a 
> graphics program, showing an image, it will work for me.

Won't be easy - a toolkit (like tkinter) will only cpature your mous 
events that are directed towards it's own windows. You might be able to 
convince your program to collect mouse-events outside for a short period 
of time - like snapshot programs do - but that will reqiure pretty 
complicated, OS-dependant coding. Certainly way more complicated than 
loading an image using tkinter. Better tell us what's giving you a hard 
time there.

Diez



More information about the Python-list mailing list