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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Free Pascal - Lazarus mailing list
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).

ps. Ubuntu x64 gtk2

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Free Pascal - Lazarus mailing list
On Fri, 28 Jul 2017 13:31:13 +0300
Alexey via Lazarus <[hidden email]> 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
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Loading...