Leser: 1
9 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 34 35 36
use strict; use Tk; # # MainWindow # my $mw = MainWindow->new; # # Menu # my $m = $mw->Menu(qw/-type menubar/); $mw->configure(-menu => $m); my $ma = $m->cascade(-tearoff => 0, -label => '~Ansicht'); my $pr_sicht = 1; $ma->checkbutton( -label => 'Projekt-Explorer', -variable => \$pr_sicht, -command => sub { # Einblenden/Ausblenden??? } ); # # PanedWindow # my $panel = $mw->Panedwindow(qw/-orient horizontal/)->pack; my $fr_left = $mw->Frame(qw/-height 100 -width 100/)->pack;; my $fr_right = $mw->Frame(qw/-height 100 -width 100/)->pack; $panel->add($fr_left, $fr_right); 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 38 39 40 41 42
#!/usr/bin/perl use strict; use Tk; # # MainWindow # my $mw = MainWindow->new; # # Menu # my $m = $mw->Menu(qw/-type menubar/); $mw->configure(-menu => $m); my $ma = $m->cascade(-tearoff => 0, -label => '~Ansicht'); my $pr_sicht = 1; # # PanedWindow # my $panel = $mw->Panedwindow(qw/-orient horizontal/)->pack; my $fr_left = $mw->Frame(qw/-height 100 -width 100/)->pack;; my $fr_right = $mw->Frame(qw/-height 100 -width 100/)->pack; $panel->add($fr_left, $fr_right); $ma->checkbutton( -label => 'Projekt-Explorer', -variable => \$pr_sicht, -command => sub { unless( $pr_sicht ){ $panel->packForget; } else{ $panel->pack; } } ); 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 38 39 40 41 42 43 44 45 46 47 48 49
use strict; use Tk; use Tk::HList; # # MainWindow # my $mw = MainWindow->new; # # Menu # my $m = $mw->Menu(qw/-type menubar/); $mw->configure(-menu => $m); my $ma = $m->cascade(-tearoff => 0, -label => '~Ansicht'); my $pr_sicht = 1; # # PanedWindow # my $panel = $mw->Panedwindow(qw/-orient horizontal/)->pack; my $fr_left = $mw->Frame->pack;; my $fr_right = $mw->Frame->pack; $panel->add($fr_left, $fr_right); my $hlist = $fr_left->HList(qw/-bg white/) ->pack(qw/-expand yes -fill both/); my $data = $fr_right->Canvas(qw/-bg white/) ->pack; $ma->checkbutton( -label => 'Projekt-Explorer', -variable => \$pr_sicht, -command => sub { unless( $pr_sicht ){ $panel->packForget; } else{ $panel->pack; } } ); MainLoop;
->pack( -fill => 'both', -expand => 1 );
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
47
48
49
50
51
use warnings;
use strict;
use Tk;
use Tk::HList;
#
# MainWindow
#
my $mw = MainWindow->new;
#
# Menu
#
my $m = $mw->Menu(qw/-type menubar/);
$mw->configure(-menu => $m);
my $ma = $m->cascade(-tearoff => 0, -label => '~Ansicht');
my $pr_sicht = 1;
#
# PanedWindow
#
my $panel = $mw->Panedwindow(qw/-orient horizontal/)->pack;
my $fr_left = $mw->Frame->pack;;
my $fr_right = $mw->Frame->pack;
$panel->add($fr_left, $fr_right);
my $hlist = $fr_left->HList(qw/-bg white/)
->pack(qw/-expand yes -fill both/);
my $data = $fr_right->Canvas(qw/-bg white/)
->pack;
$ma->checkbutton(
-label => 'Projekt-Explorer',
-variable => \$pr_sicht,
-command => sub {
unless( $pr_sicht ){
$panel->forget($fr_left);
}
else{
$panel->add($fr_left,-before => $fr_right);;
}
}
);
MainLoop;
9 Einträge, 1 Seite |