Robert Heller wrote:
> At Mon, 9 Oct 2017 21:58:38 +0200 Another One <unk...@domain.invalid> wrote:
>
>>
>> I am trying to have a text window to scroll to the end. As I understand
>> it, looking at some examples (eg.
http://wiki.tcl.tk/1455), you need to
>> define the yscrollcommand in the text window to the scrollbar and let
>> the scrollbar update the yview. In its simplest form it would be like this
>>
>> frame .t
>> text .t.log -width 80 -height 7 -borderwidth 2 -relief raised \
>> -setgrid true -yscrollcommand {.t.scroll set}
>> scrollbar .t.scroll -command {.t.log yview}
>> pack .t.scroll -side right -fill y
>> pack .t.log -side left -fill both -expand true
>> pack .t -side top -fill both -expand true
>>
>> However, when I then add messages to the text window with
>>
>> for {set i 0} {$i<20} {incr i} {
>> .t.log insert end "text line $i\n"
>> }
>>
>> the scrollbar still stays on top. Even when I tell the text window to
>> update the view with
>>
>> .t.log yview moveto 1
>>
>> It still stays with the first lines visible. What have I missed?
>
> Works fine with CentOS 6 (Tcl/Tk 8.5.7).
>
> Although, instead of ".t.log yview moveto 1", you should use ".t.log see end".
> Directly access the yview command is not recomended.
Adding '.t.log see end' solved the problem. I am curious though that it
seemed to function in some other OS... When I get hands on a Windows I