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?


In reply to Tk TableMatrix/Pane geometry problem by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.