in reply to repeating Tk widgets for data editing

Hi again. Just to show you the problem you will run into with alot of widgets, test this snippet. It runs fine as is (40 rows), but change the rows to 40000, and compare it's performance to the TableMatrix::Spreadsheet snippet. ( Hint: you will get 99% cpu usage for a minute or two or more!)
#!/usr/bin/perl use Tk; use Tk::Table; use Data::Dumper; use strict; # by pg of perlmonks.org # As you can see, it is very easy to set/get the cell values, # and modification to data is automatically reflected on screen # (you don't need to do anything). If you only want to display # data, but not editing, replace Entry with Label. my ($row, $col); #data, in your case, come from database my @cell_vars; foreach $row (0 .. 9) { my @row_vars; foreach $col (0 .. 9) { push @row_vars, $row * $col; } push @cell_vars, \@row_vars; } #presentation my $mw = MainWindow->new; $mw->geometry("600x250"); my $table = $mw->Table(-rows => 9, -columns => 9, -scrollbars => "se", -fixedrows => 1, -fixedcolumns => 1, -takefocus => 1)->pack; foreach $col (1 .. 9) { my $col_header = $mw->Button(-text => "Column " . $col); $table->put(0, $col, $col_header); } # foreach my $row (1..40000){ foreach $row (1 .. 40) { my $row_header = $mw->Button(-text => "Row " . $row); $table->put($row, 0, $row_header); foreach $col (1 .. 9) { my $cell = $mw->Entry(-width => 10, -textvariable => \$cell_var +s[$row][$col]); $table->put($row, $col, $cell); } } #manipulate data $cell_vars[5][6] = "foo"; MainLoop;

I'm not really a human, but I play one on earth. Cogito ergo sum a bum