You may have luck, but maybe you should look at TableMatrix or TableMatrix::Spreadsheet.
For example:
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::TableMatrix; my $top = MainWindow->new; my $arrayVar = {}; print "Filling Array...\n"; my ($rows,$cols) = (400, 10); foreach my $row (0..($rows-1)){ foreach my $col (0..($cols-1)){ $arrayVar->{"$row,$col"} = "$row,$col"; } } print "Creating Table...\n"; ## Test out the use of a callback to define tags on rows and columns sub colSub{ my $col = shift; return "OddCol" if( $col > 0 && $col%2) ; } my $label = $top->Label(-text => "TableMatrix v2 Example"); my $t = $top->Scrolled('TableMatrix', -rows => $rows, -cols => $cols, -width => 6, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $arrayVar, -coltagcommand => \&colSub, -colstretchmode => 'last', -rowstretchmode => 'last', -selectmode => 'extended', -selecttitles => 0, -drawmode => 'slow', -scrollbars=>'se' ); my $button = $top->Button( -text => "Exit", -command => sub{ $top->destroy}); # hideous Color definitions here: $t->tagConfigure('OddCol', -bg => 'brown', -fg => 'pink'); $t->tagConfigure('title', -bg => 'red', -fg => 'blue', -relief => 'sun +ken'); $t->tagConfigure('dis', -state => 'disabled'); my $i = -1; my $first = $t->cget(-colorigin); my $anchor; foreach $anchor( qw/ n s e w nw ne sw se c /){ $t->tagConfigure($anchor, -anchor => $anchor); $t->tagRow($anchor, ++$i); $t->set( "$i,$first",$anchor); } $top->fontCreate('courier', -family => 'courier', -size => 10); $t->tagConfigure('s', -font => 'courier', -justify => 'center'); $t->colWidth( -2 => 8, -1 => 9, 0=> 12, 4=> 14); $label->pack( -expand => 1, -fill => 'both'); $t->pack(-expand => 1, -fill => 'both'); $button->pack(-expand => 1, -fill => 'x'); Tk::MainLoop;
In reply to Re: Increase The coloumn size in Perl Tk?
by zentara
in thread Increase The coloumn size in Perl Tk?
by Kandankarunai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |