[Lazarus] Do I understand how OnIdle works?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Do I understand how OnIdle works?

Free Pascal - Lazarus mailing list
Hi,

I wonder about the use of OnIdle procedure and the Done variable. I
thougth that this routine keeps running over and over again in idle
state as long as Done=False. But the value of Done doesn't make a
difference, the OnIdle procedure  keeps repeating itself even when
Done=True.
Can anyone explain this to me?

--
mvg
Frans van Leeuwen
M 06-51695390


--
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com

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

Re: [Lazarus] Do I understand how OnIdle works?

Free Pascal - Lazarus mailing list
On Mon, 27 Jul 2020 12:05:45 +0200
frans via lazarus <[hidden email]> wrote:

> Hi,
>
> I wonder about the use of OnIdle procedure and the Done variable. I
> thougth that this routine keeps running over and over again in idle
> state as long as Done=False.

Correct.

> But the value of Done doesn't make a
> difference, the OnIdle procedure  keeps repeating itself even when
> Done=True.
> Can anyone explain this to me?

Some OS like Windows generate a lot of messages, so OnIdle is called
often, sometimes several times per second without the user
touching anything.
Look in the task manager if your app is generating cpu load. If not
then it is probably not your apps fault.

Mattias

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

Re: [Lazarus] Do I understand how OnIdle works?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 2020-07-27 05:05, frans via lazarus wrote:
> Hi,
>
> I wonder about the use of OnIdle procedure and the Done variable. I
> thougth that this routine keeps running over and over again in idle
> state as long as Done=False. But the value of Done doesn't make a
> difference, the OnIdle procedure  keeps repeating itself even when
> Done=True.
> Can anyone explain this to me?

Good question, hopefully someone else will answer as I don't know.
There might be some sample code that tells you with SimpleIPC
somewhere out there as that help documentation in the IDE might
be using it.. in the lazarus code itself if you can find it.

BTW what are you using OnIdle for if you want to tell me?
I'm trying to find more uses for it.

Maybe search the related lazarus code for OnIdle to see if it's
using it.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus