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

Re: Scrolling/keeping textArea down


On Tuesday, September 23rd, 2025 at 16:31, Admin <admin@xxxxxxxxxx> wrote:

> 23.09.2025 20:50, Lee пишет:
> 
> > How is the text being added to the TextArea?
> 
> Well, to be precise, there's httpClient receiving JSON request through
> sBuffer = Read #hClient, Lof(hClient), after that it JSON.decodes
> sBuffer into a string variable, and finally the Response.Text &='s with
> this variable. Then there's Wait 0.1, so that all the interface is
> completely redrawn and we forget about everything that was before that.
> Only then I do Pos = Response.Lenght, then EnsureVisible and already
> tried Refresh and Wait 0 after that. Same result: the scrollbar appears
> somewhere is the middle of the textArea.

I've got a process using read event that outputs into a TextArea, and this code, inside the Read Event, works for me. It might work for you as well.
Try this, replace Response.Text &= sBuffer (where Response is a TextArea) with:

Response.EnsureVisible 
Response.Insert(sBuffer)

Enjoy,

gbWilly

GambOS
Gambas3 for Debian/Ubuntu

...there is always a Catch if things go wrong!




References:
Scrolling/keeping textArea downAdmin <admin@xxxxxxxxxx>