Also, what does the @{...} syntax do

Besides confuse you? heh heh . Seriously, I'm not the expert on it, but it is an array dereference. The part in brackets {..} represent an hashref ( a hash reference), which is how stuff is stored in an object. The @ part tells it that the hashref is an array, and needs an array to put it in for display. Google for Perl Dereferencing for alot of tutorials and explanations.

As to your other question, how to get the n'th column from any row selected in the HList widget, this recently posted script shows the way.

#!/usr/bin/perl use Tk; use Tk::HList; use YAML; $top = new MainWindow; $hlist = $top->Scrolled("HList", -header => 1, -columns => 4, -scrollbars => 'osoe', -command => sub{print 1}, -width => 70, -selectbackground => 'SeaGreen3', -browsecmd => \&browseThis, )->pack(-expand => 1, -fill => 'both'); $hlist->header('create', 0, -text => 'From'); $hlist->header('create', 1, -text => 'Subject'); $hlist->header('create', 2, -text => 'Date'); $hlist->header('create', 3, -text => 'Size'); $hlist->add(0); $hlist->itemCreate(0, 0, -text => "eserte\@cs.tu-berlin.de"); $hlist->itemCreate(0, 1, -text => "Re: HList?"); $hlist->itemCreate(0, 2, -text => "1999-11-20"); $hlist->itemCreate(0, 3, -text => "1432"); $hlist->add(1); $hlist->itemCreate(1, 0, -text => "dummy\@foo.com"); $hlist->itemCreate(1, 1, -text => "Re: HList?"); $hlist->itemCreate(1, 2, -text => "1999-11-21"); $hlist->itemCreate(1, 3, -text => "2335"); MainLoop; sub browseThis{ for my $column (0..3){ print $hlist->itemCget( $hlist->selectionGet, $column, 'text' ) +, "\n"; } } =head1 my $listArrayRef = []; my @selectedindices = $hlist->info('selection'); foreach my $r (@selectedindices) { push @{$listArrayRef}, getRowArrayRef($hlist, $r); print Dump(@{$listArrayRef}),"\n"; } sub getRowArrayRef { my ($hlist, $r) = @_; my @row; foreach my $c (0 .. $hlist->cget(-columns) -1) { push @row, $hlist->itemCget($r, $c, '-text'); } return \@row; } } =cut

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re^5: A TableMatrix row selection question by zentara
in thread A TableMatrix row selection question by Anonymous Monk

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.