[Lazarus] What to replace Application.Processmessages with?

Michael Van Canneyt michael at freepascal.org
Mon Oct 26 13:00:26 CET 2020



On Tue, 13 Oct 2020, Bo Berglund via lazarus wrote:

> Now I wonder if I could put something else into the loops so that the
> main object of Application.Processmessages will be handled, namely to
> let event functions run as needed.
> Can I for example use CheckSynchronize in these loops?
>
> I.e. Application.Processmessages ==> CheckSynchronize?

Based on your description, that is all you need to do.

But I would create a routine

Procedure HandleMainLoop;

begin
{$IFDEF NOGUI}
   CheckSynchronize;
{$ELSE}
   Application.ProcessMessages;
{$ENDIF}
end;

And call that both in GUI and NOGUI.

Michael.


More information about the lazarus mailing list