Take a look at Tk::TableMatrix. It's included in the Activestate distribution, and has more documentation than Tk::TixGrid. Here's some example code with notes, extracted from one of my projects. This should give you a good start with the widget, but be sure to read the docs, there's a lot more to it.

# set up the Tk::TableMatrix grid my $grid = $mw->Scrolled('TableMatrix', -scrollbars => 'osoe', -sparsearray => 0, -titlecols => 1, # first col does not scroll -titlerows => 1, # top row does not scroll -roworigin => -1, # first scrolling (data) row is 0 -colorigin => -1, # first scrolling (data) col is 0 -padx => 2, -colwidth => 20, -anchor => 'w', -background => 'white', -resizeborders => 'none', -justify => 'left', -browsecommand => \&clickLeft, )->pack( -side =>'right', -expand => 1, -fill => 'both', ); # collect the data # column labels my @colLabels = qw( column labels here ... etc ); # from database my $data = $dbh->selectall_arrayref($sql); # number of columns my $cols = scalar @{$data->[0]}; # number of rows my $rows = 20; # populate the grid with data # hashref to hold Tk type list for grid values my $vals = {}; # add column labels to first row for (0..$cols -1){ $vals->{"-1,$_"} = $colLabels[$_]; } # add data to subsequent rows for my $ro (0..$rows -1){ # put row numbering into first column $vals->{"$ro,-1"} = $ro +1; # put data from Perl array ref into Tk list for my $co (0..$cols -1){ $vals->{"$ro,$co"} = $data->[$ro][$co]; } } # configure binds Tk list to the grid $grid->configure( -rows => $rows +1, -cols => $cols +1, -variable => $vals, );

In reply to Re: Have there been sightings of TK::TixGrid in the wild? by hangon
in thread Have there been sightings of TK::TixGrid in the wild? by generator

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.