[fpc-pascal] TFPTimer does not fire, why?

Michael Van Canneyt michael at freepascal.org
Mon Sep 7 13:17:35 CEST 2020



On Mon, 7 Sep 2020, Bo Berglund via fpc-pascal wrote:

> On Mon, 7 Sep 2020 12:40:07 +0200 (CEST), Michael Van Canneyt via
> fpc-pascal
> <fpc-pascal at lists.freepascal.org> wrote:
>
>>> Why does the FpTimer event not fire?
>>
>> Do you call checksynchronize at regular intervals ? The default timer is
>> threaded, and the OnTimer event is called in the main thread. For this to
>> work, you need to call checksynchronize at regular intervals in your main
>> thread.
>
> Before I read your reply I tested another thing:
> I dropped a regular timer from the component palette onto the form
> intending to use that instead of FpTimer.

That is because you then add the LCL to the application, and in their
application object, they call checksynchronize on idle.

Even if you remove the LCL timer, the checksynchronize still will do it's job.

Michael.


More information about the fpc-pascal mailing list