9 Einträge, 1 Seite |
$em->Label(-text => "mit rechte maustaste auf diesen text klicken");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = tkinit;
my $m = $mw->Menu();
$m->add('command', -label => 'Exit',
-command => sub { Tk::exit });
my $l = $mw->Label(-text => "Mach 'n Rechtsklick!")->pack();
$l->bind('<Button-3>' => sub { $m->Popup(-popover => 'cursor') });
MainLoop;
my $m = $mw->Menu(-tearoff => 0);
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
sub SlurpBuddyList {
my @array = ();
@array = ("user1:asdefwe", "user2:sadfr", "user3:edfqwef");
RefreshBuddyList(@array);
}
sub RefreshBuddyList {
my $m;
my $user;
my $nickname;
for(@_) {
$m = $config{MainWindow}->Menu(-tearoff => 0);
$user = (split(/\:/, $_))[0];
$m->add(
'command',
-label => "Profil von $user anzeigen",
-command => sub { GotoUrl("http://127.0.0.1/cgi-bin/goto.pl?username=$user") }
);
$nickname = $config{MainWindow}->Label(
-text => $user,-background => 'white', -font => $config{Font}
);
$nickname->bind('<Button-3>' => sub { $m->Popup(-popover => 'cursor') });
$nickname->pack();
}
}
1
2
3
4
5
sub RefreshBuddyList {
my $user;
my $nickname;
for(@_) {
my $m = $config{MainWindow}->Menu(-tearoff => 0);
9 Einträge, 1 Seite |