Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OnIdle and Threads....

15 views
Skip to first unread message

David HAROUCHE

unread,
Apr 19, 2008, 9:05:39 PM4/19/08
to
What is the place of OnIdle when using Threads ?

DH


Marc Rohloff [TeamB]

unread,
Apr 19, 2008, 9:39:51 PM4/19/08
to
On Sun, 20 Apr 2008 03:05:39 +0200, David HAROUCHE wrote:

> What is the place of OnIdle when using Threads ?

OnIdle will only be called when the UI's message loop is idle. What
happens in threads is totally irrelevant and ignored.

--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com

David HAROUCHE

unread,
Apr 19, 2008, 11:02:47 PM4/19/08
to
OnIdle takes TComponent in its constructor....

Is it correct to define one AppEvents within each PaintBox I will use (the
idle event will be there to handle mouse hold...and keyboard state and input
when the PaintBox is under the mouse) ?

Or better do only one instance managing it all ?

DH

"Marc Rohloff [TeamB]" <ma...@nospam.marcrohloff.com> a écrit dans le message
de news:1cb6pbcmbwn3$.dlg@dlg.marcrohloff.com...

Peter Below (TeamB)

unread,
Apr 20, 2008, 7:18:28 AM4/20/08
to
David HAROUCHE wrote:

> What is the place of OnIdle when using Threads ?

The two have no connection whatsoever.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com

David HAROUCHE

unread,
Apr 20, 2008, 2:23:31 PM4/20/08
to
Does it means the OnIdle never occurs while a Thread is running ?

Or should I take care of it ?

DH


Pieter Zijlstra

unread,
Apr 20, 2008, 4:53:23 PM4/20/08
to
David HAROUCHE wrote:

> Does it means the OnIdle never occurs while a Thread is running ?

No it means that OnIdle happens only in the MainThread when there are
no messages to be processed. Other threads have nothing to do with it,
they run independently.



> Or should I take care of it ?

Nope.

--
Pieter

David HAROUCHE

unread,
Apr 20, 2008, 8:10:35 PM4/20/08
to
Clear

DH


David HAROUCHE

unread,
Apr 20, 2008, 8:16:24 PM4/20/08
to
>> OnIdle is an event and has no constructor.
oups ! Talking about TApplicationEvents.Create

>> You could. But I am sure there are better ways to do this than using
> an OnIdle event.
Do you want me to lean on a Timer ?

DH


Marc Rohloff [TeamB]

unread,
Apr 20, 2008, 8:10:07 PM4/20/08
to
On Sun, 20 Apr 2008 05:02:47 +0200, David HAROUCHE wrote:

> OnIdle takes TComponent in its constructor....

OnIdle is an event and has no constructor.

> Is it correct to define one AppEvents within each PaintBox I will use (the


> idle event will be there to handle mouse hold...and keyboard state and input
> when the PaintBox is under the mouse) ?

You could. But I am sure there are better ways to do this than using
an OnIdle event.

--

0 new messages