@data[0..$#data] = ( 'a'..'x'); #### use strict; use Tk; use Tk::Table; my $mw = tkinit; my @data = ( "init", "init", "init", "init" ); my $tableWidget = $mw->Table->form(-top=>'%0', -bottom=>['%100',-20], -left=>'%0', -right=>'%100'); my $btn = $mw->Button( -command=>\&update, )->form(-top=>$tableWidget, -bottom=>'%100', -left=>'%0', -right=>'%100'); my @headers = 'a'..'k'; my $e; for ( my $row=0; $row<2; $row++ ) { for( my $col=0; $col<$#headers+1; $col++) { my $e; if( $row == 0 ) { $e = $tableWidget->Button ( -relief => "groove", -justify => "left", -text => $headers[$col], -state => 'active', -width => length($headers[$col]) ); } else { $e = $tableWidget->Entry ( # -width => $lens[$col], -textvariable => \$data[$col] ); } $tableWidget->put( $row, $col, $e ); } } sub update { @data[0..$#data] = ( 'a'..'x'); } MainLoop;