These are short questions and I hope, are simple ones

  1. In the following code, I attempt to activate the topmost cell on the left so that the arrow keys (Left, Right, Up and Down) can be used for right away browsing the cells in TableMatrix without prior having to select the cell by the mouse button click. But neither of the methods: ( activate , selectionSet ) work.

  2. Calling the methods do however, highlight the cell. The activate method causes the cell to get highlighted with grey color but the selectionSetmethod with blue color. Don't know why is the difference in color.

  3. As an aside, I'll squeeze in one more question. I've seen zentara (no longer active on this site) in Re: Increase The coloumn size in Perl Tk? using negative column indexes while setting column width.
    $t->colWidth( -2 => 8, -1 => 9, 0=> 12, 4=> 14);
         As per documentation, the value specified for setting the width can be negative (for pixels instead of positive for characters). But what do the negative value for column index refer to ?

Thanks in advance.

use strict; use warnings; use Tk; use Tk::TableMatrix; my $mw = MainWindow->new; my $tm = $mw->Scrolled('TableMatrix', -rows => 5, -cols => 10, -width => 5, -height => 12, -selecttitles => 0, -bg=>'yellow', -drawmode => 'slow', )->pack(-expand => 1, -fill => 'both'); $tm->activate("topleft"); #$tm->selectionSet("2,3"); MainLoop;

In reply to activate and selectionSet methods, negative columns in TableMatrix 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.