Assuming this is using Tk, you need to set pack propagate on for the Scrolled container. See below.
use warnings; use strict; use Tk; my $page = MainWindow->new; $page->geometry('600x200'); # Create a frame ... my $suite_fr = $page->Frame->pack(-expand => 1, -fill => 'both'); # Add a label to the frame $suite_fr->Label(-text => 'Suite:')->pack(-side => 'left'); # create a Scrolled Listbox my $suite_lb = $suite_fr->Scrolled( 'Listbox', -exportselection => '0', -height => '7', -scrollbars => 'e', -selectbackground => 'gray80', -selectforeground => 'black', -selectmode => 'extended' )->pack(-side => 'left'); my $button = $page->Button( -text => ' Fill ', -command => sub{ fillbox($suite_lb) }, )->pack; MainLoop; sub fillbox{ my $self = shift; $self->packPropagate(1); my @list = 'X' x rand 80; # Populate the ListBox with the valid suites $self->insert(0, @list); $self->Subwidget("listbox")->configure(-width => 0); }
In reply to Re: Problem setting width on Scrolled Listbox
by thundergnat
in thread Problem setting width on Scrolled Listbox
by pirishmonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |