#! perl use strict; use warnings; use Tk; use Tk::Table; my $mw = MainWindow->new(); my $upper = $mw ->Frame()->pack(-side => 'top'); my $but1 = $upper->Frame()->pack(); my $lower = $mw ->Frame()->pack(-side => 'bottom'); my $table = $lower->Table(-rows => 3, -columns => 5)->pack; upd_table(); $but1->Button ( -text => 'update', -command => sub { upd_table() }, )->pack(); MainLoop(); exit; sub upd_table { $table->clear() if $table; for my $row (0 .. 2) { for my $col (0 .. 4) { my $x = int rand 10; my $cell = $table->Entry(-width => 4, -text => $x); $table->put($row, $col, $cell); } } } #### $table = $lower->Table(-rows => 3, -columns => 5)->pack;