#!/usr/bin/perl -w use Tk; use strict; my $mw = MainWindow->new; my $c = $mw->Canvas->grid; $c->configure(-cursor => ['@images/trans_cur.xbm', 'images/trans_cur.msk', 'black', 'white']); $c->CanvasBind('' => sub { my($c) = @_; my($x, $y) = ($Tk::event->x, $Tk::event->y); print "cursor at canvas coordinate ($x,$y)\n"; }); MainLoop;