[Lazarus] Form events firing order and count

Giuliano Colla giuliano.colla at fastwebnet.it
Sun Feb 18 11:44:19 CET 2018


Il 18/02/2018 11:09, Ondrej Pokorny via Lazarus ha scritto:

> On 18.02.2018 0:59, Graeme Geldenhuys via Lazarus wrote:
>> Now comes the BIG question... Does LCL have a reference implementation?
>
> Yes, it does. It is Delphi.
>

That's not true, as far as events triggering is concerned.
Delphi implementation is to fire each visual change when requested.
LCL implementation is to queue all visual changes and to fire all of 
them at the end. This provides better efficiency but completely disrupts 
the order in which events are fired.
Those lines of code generate two events on Delphi, and just one event on 
LCL:

MyLabel.Color := clRed;
MyLabel.Color := clGreen;

To achieve the Delphi behavior in Lazarus I should code:

MyLabel.Color := clRed;
Application:ProcessMessages;
MyLabel.Color := clGreen;


Giuliano



More information about the Lazarus mailing list