[Tutor] events and popup menus

Alan Gauld alan.gauld at btinternet.com
Wed May 2 18:55:41 CEST 2012


On 02/05/12 12:33, Chris Hare wrote:
> Using the event coordinates to figure out which widget was clicked sounds like a good idea.
 > So, since the user might have moved the window on the screen,

Sorry I wasn't precise enough, I believe the mouse coordinates are the 
relative coordinates in your window. Not the full screen. So if you used 
the placer its whatever you placed it at. Otherwise you can query each 
widget for their current location/size.

Or there may be an included() method that tells you if the point is 
included in the widgets area. I can't recall how Tkinter does it and I'm 
seen GUIs do it both ways... Sorry, not near a Tkinter reference right now!

I think its in the "winfo" methods somewhere...


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list