Any suggestions?use Tk; use Tk::TableMatrix; use Tk::Text; use Tk::Dialog; use Data::Dumper qw( DumperX); my $mw = MainWindow->new; $nst = 3; my $arrayVar = {}; foreach my $row (0..10){ foreach my $col (0..$nst){ $arrayVar->{"0,0"} = "Variables"; #link to pop-up help window $arrayVar->{"0,$col"} = "r".($col/2+.5); if ($col%2 == 0) { $arrayVar->{"0,$col"} = "s".($col/2); } } } $mw->Button(-text => "Update", -command => \&update_table)->pack(-side + => 'bottom', -anchor => 'w'); my $t = $mw->Scrolled('TableMatrix', -rows => 10, -cols => $nst, -width => 6, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $arrayVar, -selectmode => 'extended', -resizeborders => 'both', -titlerows => 1, -titlecols => 1, -bg => 'white', # -state => 'disabled' # -colseparator => "\t", # -rowseparator => "\n" ); $t->tagConfigure('active', -bg => 'gray90', -relief => 'sunken'); $t->tagConfigure( 'title', -bg => 'gray85', -fg => 'black', -relief => + 'sunken'); # $t->bind("<Any-Enter>", sub { $t->focus }); $t->pack(-expand => 1, -fill => 'both'); Tk::MainLoop; sub update_table { if ($arrayVar->{"6,$col"} == 1) { $arrayVar->{"7..9,$col"}->tagConfigure(-state => 'normal'); $arrayVar->{"7..9,$col"}->tagConfigure(-state => 'disabled'); $arrayVar->{"7..9,$col"}->tagConfigure(-state => 'disabled'); } # foreach my $row (1..10){ # foreach my $col (1..$nst){ # unless ($arrayVar->{"$row,$col"} =~ /[0-9]+/) { # $D = $mw->Dialog( # -title => 'Warning', # -text => "Please enter a valid number for $row,$col +!\n", # -font => 'Times 10', # -default_button => 'OK'); #$D->bell; #$D->Show; # } # } # } }
In reply to Tk ::TableMatrix by lil_v
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |