http://www.perlmonks.org?node_id=1053969

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

Dear Monks

I'm working on a Tk GUI and I have a rather small problem, but I can't figure pout what I'm doing wrong. I'm using TK::TableMatrix and I can't let the table fill the whole pane if the user enlarge the main window. Here's a simplified working code

#!/usr/bin/perl -w use warnings; use Tk; use Tk::Pane; use Tk::TableMatrix; my $mw_top = MainWindow->new(); $mw_top->geometry( "826x900" ); $mw_top->resizable(1, 1 ); our $mw = $mw_top->Scrolled(Pane, Name => 'fred', -scrollbars => 's', -sticky => 'we', -gridded => 'y', -background => 'blue' ); $mw->Frame; $mw->pack(-expand => 1, -fill => 'both'); GUI(); Tk::MainLoop; sub GUI { my $frame_commons_first_level = $mw->Frame (-background => 'white')->p +ack(-side => 'top', -expand => '0'); my $frame_entry_info = $mw->Frame (-background => 'white')->pack(-side + => 'top', -expand => '0'); my $frame_table = $mw->Frame( -background => 'white',-relief => 'ridge +')->pack(-side => 'top', -expand => '1', -fill => 'both'); my $rows=100; my $cols=10; foreach my $row (0..($rows-1)){ $arrayVar->{"$row,0"} = "$row"; } foreach my $col (0..($cols-1)){ $arrayVar->{"0,$col"} = "$col"; } sub colSub{ my $col = shift; return "OddCol" if( $col > 0 && $col%2) ; } our $t = $frame_table->Scrolled('TableMatrix', -rows => $rows, -cols => $cols, -height => 60, -titlerows => 1, -titlecols => 0, -variable => $arrayVar, -coltagcommand => \&colSub, -browsecommand => \&brscmd, -colstretchmode => 'last', -wrap=>1, -multiline=>1, -relief => 'ridge', -rowstretchmode => 'last', -selectmode => 'extended', -selecttype=>'row', -selecttitles => 0, -drawmode => 'slow', -scrollbars=>'e', -ipadx=>3, -pady=>3, -padx=>1, )->pack(-expand => '1', -fill => 'both'); }

Where is the fault?