Hallo,
jetzt hatte ich Zeit für ein kleines Beispiel, ich hoffe, es hilft dir weiter:
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,