[Lazarus] LCL don't paint to canvas if a key is holded

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 28 12:46:35 CEST 2017


On Fri, 28 Jul 2017 13:31:13 +0300
Alexey via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> Problem: CudaText editor opens 400K file at the end, syntax parser is 
> slow, I hold "d" char. expected: "d" or "d"*n chars appears from time to 
> time. Eg each 1-2 seconds. Seen: 
> "ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" 
> chars appears each 5-6 seconds. Not ok.
> 
> Maybe LCL don't call Paint method during holding a key (if component 
> paints slowly)? How to solve it? Or i must force repaint to canvas each 
> 1-2 seconds (not all platforms support it, Mac don't).

A forced repaint will only decrease the responsiveness of your
application even more.
If the syntax parser is so slow, the first thing to do is to *not* call
it after every key stroke. Call it on idle or in OnPaint.

Mattias


More information about the Lazarus mailing list