FunnyName has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: updating size of scrollable Area in TK::Table
by Anonymous Monk on May 11, 2009 at 22:19 UTC | |
by FunnyName (Initiate) on May 12, 2009 at 07:49 UTC | |
|
Re: updating size of scrollable Area in TK::Table
by zentara (Cardinal) on May 12, 2009 at 10:21 UTC |