Leser: 4
3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
use strict;
use warnings;
use Carp qw/croak/;
use Data::Dumper qw/Dumper/;
use Tk;
use Tk::Canvas;
my $mw = Tk::tkinit();
my $c = $mw->Canvas(-width => 800, -height => 640,)->pack(-fill => 'both', -expand => 1);
my $x = 0; my $y = 0;
my $pos_label_x = $mw->Label(-textvariable => \$x)->pack();
my $pos_label_y = $mw->Label(-textvariable => \$y)->pack();
$c->Tk::bind('<Motion>',[\&print_coords,Ev('x'),Ev('y')]);
my $text_id = $c->createText(50, 50, -text => "variabler Text");
my $oval_id = $c->createOval(10, 10, 60, 40, -fill => 'white');
$mw->MainLoop();
sub print_coords {
shift;
$x = $_[0];
$y = $_[1];
} # /print_coords
#Kein Kommentar+2008-08-26 17:56:53--versuch mal den befehl bbox
3 Einträge, 1 Seite |