Help for this page

Select Code to Download


  1. or download this
    $canvas{'ref'}->CanvasBind("<1>", [ \&print_xy, Ev('x'), Ev('y') ]); 
    
    ...
       my ($canv, $x, $y) = @_;
       print "(x,y) = ", $canv->canvasx($x), ", ", $canv->canvasy($y), "\n
    +";   
    }
    
  2. or download this
             $canvas{'ref'}->CanvasBind("<1>" =>
                      sub{
    ...
                            my $y = $canvas{'ref'}->canvasy($screenY);
                            print "($x,$y)\n";
                         });