ruud144 schrieb am 14.03.2013 14:31:> On Mar 14, 12:16 pm, ruud144
You are right, the packing order determines which widget disappears first.
But please note, that for the initial size of the whole window and a
clean behaviour on resizing (reduce and enlarge!), you should use
appropriate
combinations of the -side, -anchor, -fill and -expand options.
Moreover esp. listboxes have a -height option for the initial nb of lines.
#!/usr/bin/perl
use warnings;
use strict;
use Tk::widgets qw(Listbox Button);
my $top = MainWindow->new();
my $button = $top->Button(
-text => 'ok',
-command => sub {
exit(0);
})->pack(
-side => 'bottom',
-anchor => 's',
-fill => 'x',
-expand => '0' );
my $listframe = $top->Frame(
-borderwidth => '2',
-relief => 'raised',
)->pack(
-expand => '1',
-fill => 'both',
-side => 'top', );
my $lb = $listframe->Scrolled(
'Listbox',
-scrollbars => 'ow',
-selectmode => 'extended',
-label => 'test',
-takefocus => 1,
-height => 8,
)->pack(
-side => 'top',
-anchor => 'nw',
-fill => 'both',
-expand => '1' );
foreach ( 1 .. 13 ) { $lb->insert( 'end', "entry$_" ); }
Tk::MainLoop();
HTH, Horst
--
<remove S P A M 2x from my email address to get the real one>