[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling/keeping textArea down


On 9/23/25 11:34 AM, Admin wrote:
Ok, so I just tested this in a new clean app.


I created a textArea filled with "all work and no play makes jack a dull boy" lines so that the right (and only) scrollbar would be, like, one-third of all text


Then I created a button:


Public Sub Button1_Click()

   TextArea1.Insert(" ")
   TextArea1.EnsureVisible

End


If I just press the button, nothing happens.

If I manually place a cursor in the bottom of a textArea and scroll it back up and then press a button, sure enough it scrolls right down.

So basically .Insert does not place a cursor to the end of the text in a textArea where it inserts.

When I add text to a TextArea with either .Insert() or the '&=' operator, I don't even need to call .EnsureVisible(). The text is scrolled to the bottom as needed.

Are you using Qt or GTK?


And, BTW, TextArea.Length apparently does indeed take UTF-8 characters into account. I did a small test, and after adding UTF-8 text to a TextArea multiple times, TextArea.Length and TextArea.Pos have the same value. So, there should be no need to set .Pos explicitly prior to calling .EnsureVisible().


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: Scrolling/keeping textArea downAdmin <admin@xxxxxxxxxx>
References:
Scrolling/keeping textArea downAdmin <admin@xxxxxxxxxx>
Re: Scrolling/keeping textArea downLee <t.lee.davidson@xxxxxxxxx>
Re: Scrolling/keeping textArea downBruce Steers <bsteers4@xxxxxxxxx>
Re: Scrolling/keeping textArea downgbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: Scrolling/keeping textArea downAdmin <admin@xxxxxxxxxx>
Re: Scrolling/keeping textArea downAdmin <admin@xxxxxxxxxx>