Leser: 2
8 Einträge, 1 Seite |
1
2
3
4
5
6
$c->bind("<1>" => sub {
my $e = $c->XEvent;
my($x, $y) = ($c->canvasx($e->x),
$c->canvasy($e->y));
....
}
1
2
3
4
5
6
7
8
9
10
my $canvas = $mw->Canvas(-width => '350',
-height => '350',
-bg => '#FFFFFF',
)
->pack();
$canvas->bind("<1>" => sub {
my $e = $canvas->XEvent;
my($x, $y) = ($canvas->canvasx($e->x),
$canvas->canvasy($e->y));
$canvas->createLine($x, $y, ($x+50), ($y+50));
$canvas->Tk::bind(...)
8 Einträge, 1 Seite |