[Lazarus] How to fix slow screen refresh of TListbox?

Bo Berglund bo.berglund at gmail.com
Sun Nov 20 08:23:02 CET 2022


On Fri, 18 Nov 2022 18:40:57 -0300, Flávio Etrusco via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>Em dom., 13 de nov. de 2022 às 18:36, Luca Olivetti via lazarus <
>lazarus at lists.lazarus-ide.org> escreveu:
>
>> El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit:
>> > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus
>> > <lazarus at lists.lazarus-ide.org> wrote:
>> >
>> >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit:
>> >>
>> >>> But how to jump to the end of the text on screen?
>> >>>
>> >>
>> >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1
>> >>
>> >
>> > Did not work, but this does work:
>>
>> Strange, I've been using it for many years (and still use it) to ensure
>> the last line is visible.
>>
>> (...)
>> --
>> Luca Olivetti
>> Wetron Automation Technology http://www.wetron.es/
>> Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
>>
>
> It should work. Or even straight
>"TheSynEdit.TopLine:=TheSynEdit.Lines.Count;'.

My current version of my logging tool application uses this to display incoming
data on the serial port (where it ends up in the TBytes buffer DataBuffer[]
before displaying):

...
  SetLength(DataTxt, Length(DataBuffer)); //Set string length
  Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); //Copy data to string
  {$ifdef USESYNEDIT}
    synRxData.Lines.Beginupdate;
    synRxData.Lines.Text := DataTxt;
    synRxData.CaretY := synRxData.Lines.Count;
    synRxData.Lines.Endupdate;
    stxLineCount.Caption := IntToStr(synRxData.Lines.Count);
  {$else}
...


Right now it has been running since 2022-11-19 01:20:05 and contains 11936 log
lines and whenever new data arrive it is almost instant on screen when it loads
the new lines and displays the very bottom of the list...


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list