rzer10 has asked for the wisdom of the Perl Monks concerning the following question:

How do you get XY coordinates in a scrolled Canvas object? $Tk::event->x and $Tk::event->y work fine for normal un-scrolled Canvas objects. But in a scrolled Canvas, the event methods only give to the coordinates to the upper left corner in the view. It does not take into account the scroll location. I am out of ideas and would greatly appreciate any suggestions.
  • Comment on Getting coordinates in a scrolled canvas

Replies are listed 'Best First'.
Re: Getting coordinates in a scrolled canvas
by rzer10 (Acolyte) on Jan 31, 2007 at 19:00 UTC
    OK, I think I got it finally. For anyone interested, its $canvas->canvasx($Tk::event->x), $canvas->canvasy($Tk::event->y).
Re: Getting coordinates in a scrolled canvas
by lin0 (Curate) on Jan 31, 2007 at 18:57 UTC

    Hi rzer10

    Interesting question you posted out there! You should look at the thread: Tk mysteries. for some possible solutions. In particular, you might want to look at the node: Re: Tk mysteries..

    I hope this helps,

    Cheers,

    lin0