use Tk; use Tk::TableMatrix; my $top = MainWindow->new; my $screen_height = int(($top->screenheight) * 0.8); my $screen_width  = int(($top->screenwidth ) * 0.95); my $geometry = $screen_width . 'x' . $screen_height; $top->geometry("$geometry-0+0"); my $arrayVar = {}; foreach my $row  (0..20){ foreach my $col (0..10){ $arrayVar->{"$row,$col"} = "r$row, c$col"; } } my $button_frame=$top->Frame->pack(-side => 'top'); $button_frame->Button(-text => "Increase Row Height", -command => \&increase_row_height)->pack(-side => 'top', -anchor => 'center'); my $table_frame=$top->Frame(-background => '#b0c4df')->pack(-expand => 1, -side => 'top', -fill => 'both'); my $t = $table_frame->Scrolled('TableMatrix',                    -rows => 21, -cols => 11,                    -width => 11, -height => 21,        -titlerows => 1,    -titlecols => 1,        -variable => $arrayVar,        -selectmode => 'extended',        -colstretchmode => 'all', -resizeborders => 'both',        -bg => 'white',                    );     $t->tagConfigure('active', -bg => 'gray90', -relief => 'sunken'); $t->tagConfigure( 'title', -bg => 'gray85', -fg => 'black', -relief => 'sunken'); $t->pack(-fill => 'x'); Tk::MainLoop; sub increase_row_height {    $t->rowHeight(2,4);    $t->configure(-height => 25); $t->packForget; $t->pack(-fill => 'x'); }