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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.