Die Packerei

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]

runplex.pl
my $top = new MainWindow;
my $title = "Perl Example";
$title .= ": $name" if defined $name;
$top->title($title);

my $bf = $top->Frame();
$bf->pack('side' => 'top', @fillx);
my @buttons = (
   ['RELOAD' => sub { load($dir, @files) }],
   ['QUIT' => sub { exit }],
);
foreach my $button (@buttons) {
   my $b = $bf->Button(
      '-text' => $button->[0],
      '-command' => $button->[1],
      '-width' => 6,
   );
   $b->pack('side' => 'left', @expandx);
}

*Gepackt wird von oben nach unten und innerhalb von Frames von links nach rechts.
 
*Bei Leiste mit Buttons empfiehlt es sich, allen die gleiche Weite mitzugeben.
 
*@fillx steht für 'fill' => 'x' und @expandx ist eine Kurzform für 'fill' => 'x', 'expand' => 'y'.
 

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]
Copyright © 1996 - 2003 Andreas Borchert, in HTML konvertiert am 01.10.2003