1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $window = MainWindow->new;
$window ->update();
my $checkbutton=$window->Checkbutton(-text=>"Checkbutton1",
-anchor=>'w')->pack();
MainLoop;
... = $mw->CheckButton( ... -variable => \$variable );
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $window = MainWindow->new();
$window->title('test');
my $fo = $window->Frame()->pack(-side => 'top',
-expand => 1,
-fill => 'both',
);
my $f1 = $fo->Frame(-borderwidth => 3,
-relief => 'groove',
)
->pack(-side => 'left',
-expand => 1,
-fill => 'both',
);
$f1->Label(-text=>'Uhrzeiten')->pack();
my $stunde1 =0;
my $stunde2 =0;
$f1->Checkbutton(-text => "Stunde 1",-variable=>\$stunde1)->pack();
$f1->Checkbutton(-text => "Stunde 2",-variable=>\$stunde2)->pack();
$window->Button(-text=>'OK',-command=>sub{
print $stunde1,
print $stunde2,
},
)->pack();
MainLoop();
2012-11-27T13:06:40 1860gelbHab da trotzdem noch eine Frage:
wieso gibt mir die Konsole 3 Werte aus?