Reading coords from a scrolled Tkinter Canvas widget?

Phlip phlip_cpp at yahoo.com
Sun Jun 2 13:06:21 EDT 2002


G. Willoughby wrote:

> I am having a few problems reading the correct coords from a scrolled
> canvas widget! e.g. i have a .jpg about 2000x2000pixels displayed inside a
> canvas widget measuring 564x564pixels when i scroll the canvas using the
> attached scrollbars i want to click the mouse and read the x/y coords of
> the .jpg where my cursor is, not the canvas widget, any ideas? This is the
> code i have at the minute:

Your code appears not to grok canvasx and canvasy. They translate event.x 
style coordinates to canvas model coordinates.

BTW you could be using a Python Megawidgets Pmw.ScrolledCanvas here. More 
features less pain.

-- 
  Phlip
            http://www.greencheese.org/MakeItSo
  --  DARE to resist drug-war profiteering  --




More information about the Python-list mailing list