What I have is a TextUndo widget and a ROText widget side by side. The TextUndo widget is the main window and the ROText is simply a 4 pixle width column that does line numbering.

I have the two mapped and they scroll congruently using yscrollcommand so that is fine. I also created a function to have the scroll congruently when using a binded mousewheel scroll I had already implemented. The last thing that I am having issues with is if you use the arrow keys to scroll up or down. When I start on line "0" and hit the down arrow key to line one everything is fine but as soon as I hit it again and the line number value becomes 2 the ROText widget jumps all the way down to the last line of that widget but the TextUndo widget remains where it is at.

As you cans ee from my source code I have tried a few methods using yview and implenting the "-pickplace" option but this option is suppose to be obsolete and replaced by the see() function. The closest I have gotten to the performance I want is using yviewMoveto(). However when I do this I start on line 0 and hit the arrow button down one and the line number column then shows the number 2 as the first number in the list and the TextUndo widget does not scroll so now the line number no longer matches up to it's line.

I have also gotten them to stay together by having them both scroll when I hit the down key but this is not what I want either because neither window should scroll untill the value of "index" is off the screen (not visible). In the last example this is not the case. If I were to start on line 0 and hit the down arrow key both widgets would scroll and would now show line 1 at the top of the widget and move line 0 off the screen even though line 1 was already visible the widgets would still scroll to adjust.

I hope that clears some things up. I know this is somewhat confusing especially when you are not really sure what I am doing in the first place.


In reply to Re^4: Valid values of Tk::Text see() function. by Anonymous Monk
in thread Valid values of Tk::Text see() function. 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.