Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: activate and selectionSet methods, negative columns in TableMatrix (focus)

by Anonymous Monk
on Jan 22, 2015 at 07:29 UTC ( #1114109=note: print w/replies, xml ) Need Help??


in reply to activate and selectionSet methods, negative columns in TableMatrix

Its called focus
$tm->focus;

But what do the negative value for column index refer to ?

What do the docs say? What does the source say? The C-source?

so ... Tk::TableMatrix, http://search.cpan.org/grep?cpanid=CERNEY&release=Tk-TableMatrix-1.23&string=colWidth&i=1&n=1&C=9#pTk/mTk/Tktable/tkTable.c

I think -2 referes to the second to last column, and -1 to the last column ... you can use colWidth for introspection, so you can use it to dump the column widths before and after

I'm cute , right ? :)

  • Comment on Re: activate and selectionSet methods, negative columns in TableMatrix (focus)
  • Download Code

Replies are listed 'Best First'.
Re^2: activate and selectionSet methods, negative columns in TableMatrix (focus)
by Anonymous Monk on Jan 22, 2015 at 09:54 UTC
    Hi There,

        Thank you for the swift response.
    1. Yes. $tm->focus; does it make it work and thank you for that. Now I realize that $tm->activate("topleft"); doesn't implicitly call $tm->focus;. That said,
      $tm->focus; $tm->activate("topleft");
      has the same effect as,
      $tm->activate("topleft"); $tm->focus;
      I'm not sure why this is so.

    2. Any answers to second question?

    3. I'm a entry level learner. So I don't understand the Perl source code well. That aside, while answer the sounds reasonable that -ve column numbers refer to those from counted from the right(starting rightmost column at -1 as there is no -0), I tried
      $tm->colWidth (0, 25); print $tm->colWidth(), "\n";

      prints,
      0 25

      $tm->colWidth (-10, 32); $,="|"; print $tm->colWidth(), "\n";

      prints,
      0 25|-10 32|
    4. Now -10 refers to first column. The following callback for -browsecommand option,
      sub validate_browse { $tm->colWidth (-10, 32); $tm->configure(-padx =>($tm->cget(-padx))); #display refresh trick, }
      doesn't change the width of first column. Why is this so?

      Many thanks in advance.

      Any answers to second question?

      Yes, figure it out :)Tk::WidgetDump can help you get more diagnotical with most widgets

      I'm a entry level learner...Why is this so?

      :) Second verse same as the fist :) you're going to have to write a little code to figure it out, and maybe read a bit of code -- a good 15-60 minutes of work ... maybe

      Oooh, another hint, the "original" tablematrix documentation might answer stuff (might not too) http://tktable.sourceforge.net/tktable/doc/tkTable.html

      I'm just not in the mood for a tk info hunt ATM , sorry :)

        Hey,
                Thank you for providing me the information pointers in the limited time you have. I'll try to dig around and find out. Hopefully, I'll not get lost.

                That aside, in the first reply you asked

        ....I'm cute , right ? :)

        Well, AM is talking to AM (like smiling by standing in front of mirror). So one is always cute to ones own self. Needless to say then that you're cute. Because, I'm cute.

        Thanks again. Have a good day

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1114109]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2020-01-21 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?