Thread Tk Canvas (Image Area oder Mouse Coordinates) (4 answers)
Opened by StrongSteve at 2007-06-05 21:43

Sucher
 2007-06-07 00:50
#46419 #46419
User since
2007-03-26
47 Artikel
BenutzerIn
[default_avatar]
Hallo,

jetzt hatte ich Zeit für ein kleines Beispiel, ich hoffe, es hilft dir weiter:
Code: (dl )
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
use warnings;
use strict;
use Tk;
use Tk::Balloon;

my $mw = tkinit;
my $can = $mw->Canvas->pack;
$can->createRectangle(10,10,100,100,-fill=>'red');
my $left = $can->createRectangle(10,10,50,100,
-stipple => 'transparent',
-fill => 'black',
-outline => '',
-tags => ['left'],
);
$can->bind($left,'<1>',sub{
$mw->messageBox(-message => 'you clicked the left side!');
});
my $b = $mw->Balloon();

$b->attach($can,
-balloonposition => 'mouse',
-msg => {'left' => 'click here for a message',
},
);
MainLoop;


Grüße,

View full thread Tk Canvas (Image Area oder Mouse Coordinates)