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. |