hello,

i have some problems with TK:Table with dynamic Content and its scrolling-functionality. The Table is created with following params:

$f2->Table( -takefocus => 0, -highlightcolor => $bgColor, -relief => 'groove', -borderwidth => 2, -columns => 3, -fixedrows => 1, -fixedcolumns => 2, -scrollbars => 'se')->pack...

The Content of the Table (rows) is dynamic and therefore changes. If it grows larger, the scrollable Area grows too. (correct) But sometimes i have to remove some rows from the table. (in fact the table is filled from a hash-table each time an update occurs and i have to delete obsolete rows manually, since i use a Version of TK (800.024) in which Table->clear isn't implemented yet.) The removal of the oboslete widgets works fine, but the scrollable Area doesn't resize correctly, so it looks like there are left empty rows at the and of the table, where the deleted rows/widget were.

my $AktRows = $table->totalRows; my $AktCols = $table->totalColumns; my $AnzActivities = keys %AktActivityRec; if( $AnzActivities < ($AktRows-1) ) { for(my $row=($AnzActivities+1); $row < $AktRows; $row++) { for(my $col=0; $col < $AktCols; $col++) { my $widget = $table->get($row, $col); if ($widget) { $table->LostSlave($widget); $widget->destroy(); } } } } $table->update;

How can i force the table to resize the scrollable area?

UPDATE: after some debugging i found out, that it's a problem with the row-count of the table. although the widgets are correctly destroyed the table still contains their rows. but i couldn't find any hint how to remove a complete row from the table. can anyone help?


In reply to updating size of scrollable Area in TK::Table by FunnyName

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.