[Lazarus] What to replace Application.Processmessages with?

Michael Van Canneyt michael at freepascal.org
Wed Oct 28 10:48:45 CET 2020



On Wed, 28 Oct 2020, Bo Berglund via lazarus wrote:

> On Mon, 26 Oct 2020 13:00:26 +0100 (CET), Michael Van Canneyt via
> lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>>
>>
>> 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.
>>
>
> Is NOGUI defined also when *not* using the nogui widgetset? I.e. in a
> simple program?

As far as I know you must define this yourself.

Michael.


More information about the lazarus mailing list