Leser: 1
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
32
33
use strict;
use warnings;
use Tk;
my $mw =
tkinit ();
my $frame = $mw-> Frame (-relief => 'groove', -bd => 2)-> pack ();
my $text = $mw-> Text ()->pack (-expand => 1);
my $widget =
$frame-> Label (
-text => "Hier ist ein Widget!",
);
my $widget_on = 1;
my $button =
$mw-> Button (
-text => "Widget an/ausschalten",
-command => sub {
if ($widget_on == 0){
$widget-> pack ();
$widget_on = 1;
}
else{
$widget-> packForget ();
$widget_on = 0;
}
}
)-> pack;
Tk::MainLoop ();
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
use strict;
use warnings;
use Tk;
my $mw =
tkinit ();
my $frame = $mw-> Frame (-relief => 'groove', -bd => 2)-> pack ();
my $text = $mw-> Text ()->pack (-expand => 1);
my $widget =
$frame-> Label (
-text => "Hier ist ein Widget!",
)->pack;
my $widget_on = 1;
my $button =
$mw-> Button (
-text => "Widget an/ausschalten",
-command => sub {
if ($widget_on == 0){
$frame-> pack (-before => $text);
$widget_on = 1;
}
else{
$frame-> packForget ();
$widget_on = 0;
}
}
)-> pack;
Tk::MainLoop ();
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
use strict;
use warnings;
use Tk;
my $mw =
tkinit ();
my $frame = $mw-> Frame (-relief => 'groove', -bd => 2)-> pack ();
my $text = $mw-> Text ()->pack (-expand => 1);
my $widget =
$frame-> Label (
-text => "Hier ist ein Widget!",
);
my $widget_2 =
$frame-> Frame (
-height => 0,
)-> pack;
my $widget_on = 1;
my $button =
$mw-> Button (
-text => "Widget an/ausschalten",
-command => sub {
if ($widget_on == 0){
$widget-> pack ();
$widget_on = 1;
}
else{
$widget-> packForget ();
$widget_on = 0;
}
}
)-> pack;
Tk::MainLoop ();
3 Einträge, 1 Seite |