k0rn has asked for the wisdom of the Perl Monks concerning the following question:

I have to widgets one on right side of the main window one on the left side of the main window. When the window is maximized theirs a huge gap between windows instead of adjusting the widget size accordingly. Heres the code for the two widgets. Their put into a frame.

UPDATE: I got it to fill the space by making -expand to 1. The only problem now is the right widget is way to big. I need the right widget to stay at its same width that it was before the main window is maximized.
# Our Main Window my $mainWindow = new MainWindow; # Create a frame for our widgets my $frameMain = $mainWindow -> Frame( -relief => 'sunken' ); my $scrolledText = $frameMain -> Scrolled( 'Listbox', -scrollbars => 'oe', -background => 'white', #-foreground => 'black', -width => '90', -height => '30' ); $scrolledText -> pack( -fill => 'both', -expand => '0', -side => 'left' ); my $scrolledNicks = $frameMain -> Scrolled( 'Listbox', -scrollbars => 'eo', -background => 'white', #-foreground => 'black', -width => '10', -height => '30' ); $scrolledNicks -> pack( -expand => '0', -fill => 'both', -side => 'right' );

Replies are listed 'Best First'.
Re: Tk gap between widgets on expand
by lamprecht (Friar) on Mar 29, 2010 at 07:33 UTC

    If you want the right widget to keep its width, don't make it expand.

    see Tk::pack for an explanation of the packer algorithm

    Cheers, Chris
      Thanks that worked.