If you are not stuck on the idea of the nice window look, you could use the tag mechanism to make a disabled tag, and color it someway.
#!/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, ); foreach my $col(1..500) { foreach my $row(1..7) { my $blank = $table->Label( -text => "", -background => 'white', -cursor => [ 'left_ptr' ] ); if ( $row == 3 ){ $table->set("$row,$col",42); next } if( $row == 4 ){ my $button = $table->Button( -text => "$col enabled", -command => sub { $table->see( "0,300" ); } ); $table->windowConfigure( "$row,$col", -window => $button, -stick +y => 'nsew' ); }else{ $table->windowConfigure( "$row,$col", -window => $blank, -sticky + => 'nsew' ); } } } $table->pack( -expand => 1, -fill => 'both' ); MainLoop;
In reply to Re: Non editable cells in Tk::TableMatrix
by zentara
in thread Non editable cells in Tk::TableMatrix
by ravishi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |