snosniv <
[email protected]> wrote:
Is it possible to make a text widget scroll when lines of text reach the bottom of the window?
At the moment, I can display 10 lines of text, but lines 11 & beyond are off the window bottom, although I can scroll down with the mouse, I'd prefer if it'd auto scroll as each extra line was added.
This is a sample of adding one line of text, which is short, all lines about 30 chars max & fit a line easily:
$f7.txt00 configure -state normal
$f7.txt00 insert insert "$blk_cnt:- <'simple text to output'>\n"
$f7.txt00 configure -state disabled
incr blk_cnt
TIA, Kev P.
What you are looking for is the "see" sub-command to the text widget.
With the 'end' index.
If you want the widget to always show the last line added then:
$text insert end "new line of text\n"
$text see end
Note that 'end' there is a text index, so other valid indexes are also possible, to move the view to show that index within the widget.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)