in reply to Question about packing frames

Change this line

)->pack(-fill=>'y', -expand=>1,

to

)->pack(-fill=>'y', -expand=>0,

Replies are listed 'Best First'.
Re^2: Question about packing frames
by CrashBlossom (Beadle) on Oct 21, 2019 at 23:02 UTC

    Thanks for your reply, but this change does not affect the unwanted behavior.

    Here is some more detail. The left frame is the $ctl frame. It contains some widgets. The right frame is the $cbox frame. It is empty. The background of the $cbox frame is blue. The background of the main window is yellow. If I use the cursor to manually widen the main window, the $cbox frame pulls away from the $ctl frame, exposing a portion of the main window (yellow) in between. This is what I want to change. I want the $cbox frame to occupy all the area to the right of the $ctl frame, no matter how big I make the main window.

      I just noticed there is more than one -expand=>1
      Change the first one.

      Here's more context:

      my $ctl = $mw->Frame(-borderwidth => 1, -relief => 'solid', -width => 300, -bg => 'aquamarine', )->pack( -side=>'left', -fill=>'y', -expand=>0, -anchor => 'w', );

        Your are right!

        Thought I had tried that, but apparently not. I would have thought that if the left frame was expanding in X, I would see the left frame's aquamarine background instead of the main window's gold background. But I guess some of Perl's mysteries are unfathomable.

        Anyway, thanks!

      That change works for me.
      It does exactly what you say you want. It does not expose any yellow.
      Are you sure you are running the changed code?