I have encountered some problems along the way. I am using POE and Tk together so this may be the problem.
1)If I'm using Tk::TableMatrix I have no problems regarding Buttons, they are showed on the screen I'm very happy... BUT , the -variable property that is used when I create the Tk::TableMatrix needs to fit my needs as I'm using POE,so I choose to have it in $heap->{tablearray}. If I don't define it before using it it's no problem because it's autovivified anyway ,however, if I do define it before I use it ,like this $heap->{tgarray},I get this very strange error:
bad table index "0": must be active, anchor, end, origin, topleft, bottomright, @x,y, or <row>,<col> at /usr/lib/perl5/Tk.pm line 247./code>2)I have tried to isolate the problem. My conclusion was that Tk::TableMatrix for some reason does not let me modify text entries in cells at run-time. The testacase that supports this ideea is the following:
use strict; use warnings; use Tk; use Tk::BrowseEntry; use Tk::TableMatrix; use Data::Dumper qw( DumperX); my $top = MainWindow->new; my $stuff = {}; my $tg = $top->Scrolled( 'TableMatrix', -rows => 21, -cols => 11, -width => 10, -height => 20, -titlerows => 1, -titlecols => 1, -variable => $stuff, -selectmode => 'extended', -resizeborders => 'both', -titlerows => 1, -titlecols => 1, -bg => 'white', )->pack( -expand => 1, -fill=>'both' ); $tg->tagConfigure('active', -bg => 'gray90', -relief => 'sunken') + ; $tg->tagConfigure('title', -bg => 'gray85', -fg => 'black', -relief => + 'sunken') ; $top->Button( -text=>'modify', -command=> sub { $stuff->{'3,3'} = 'asfasf'; }, )->pack; Tk::MainLoop;
In reply to problems using Tk::TableMatrix by spx2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |