#!/usr/bin/perl use Tk; use Tk::TableMatrix; use strict; use warnings; my $arrayVar = {}; print "Filling Array...\n"; my ($rows,$cols) = (6, 500); foreach my $row (1..$rows){ $arrayVar->{"$row,0"} = "$row"; } foreach my $col (1..$cols){ $arrayVar->{"0,$col"} = "$col"; } my $mw = MainWindow->new; my $table = $mw->Scrolled( "TableMatrix", -resizeborders => 'none', -titlecols => 1, -rows => 7, -colstretchmode => 'all', -cols => 501, -cache => 1, -scrollbars => "osoe", -variable => $arrayVar, )->pack( -expand => 1, -fill => 'both'); $table->tagConfigure('dis', -state => 'disabled', -bg => 'white'); $table->tagConfigure('act', -state => 'normal', -bg => 'lightyellow'); foreach my $col(1..500) { foreach my $row(1..7) { # $table->set("$row,$col","$row-$col"); $table->tagCell('dis',"$row,$col"); if($row == 4){ $table->set("$row,$col",'Active'); $table->tagCell('act',"$row,$col"); } } } my $button = $mw->Button(-text=>'Activate Row 2', -command=>sub{ # $table->tagDelete('dis', 2); $table->tagRow('act', 2); $table->tagRaise('act'); })->pack(); MainLoop; __END__