in reply to Re: Increase The coloumn size in Perl Tk?
in thread Increase The coloumn size in Perl Tk?
I ran your code and it works great. I tried to add a '-' button but can't get it to work. Any ideas?
use Tk; use Tk::Table; $t = MainWindow->new(-title=>"tablesize") ->Table(rows => 5, columns => 5)->pack; for $x (0 .. 4) { for $y (0 .. 4) { $t->put($x, $y, "$x:$y"); } }; $t->parent->Button(-text =>"+", -command => sub { $x1=$t->get(2,2); $x1->configure(-width => $x1->cget("-width") + +1); } )->pack; $t->parent->Button(-text =>" - ", -command => sub { $x1=$t->get(2,2); $x1->configure(-width => $x1->cget("-width") - +1); } )->pack; MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Increase The coloumn size in Perl Tk?
by Anonymous Monk on May 10, 2011 at 14:55 UTC |