<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid200611071357.15698.JeLlyFish.software@gmx.net"
type="cite">
<pre wrap="">I can't call callbacks in threads? Why's that? Or am I understanding
something wrong?
</pre>
</blockquote>
Of course you can use "events" (aka class properties that are
functions) in threads. That is just the Object Pascal syntax. But in
the main thread in Delphi or Lazarus events of GUI objects (e.g.
TButtons) are called "automatically" by user actions (thus in effect by
hardware events, which cause messages in Windows). This is not possible
with threads in Delphi, as system messages are sent to the main (GUI)
thread of a project. A thread can _programmatically_ wait for a
message, but the Delphi (and Lazarus) event scheduler that calls events
of GUI based objects only works for the main thread.<br>
<br>
<blockquote cite="mid200611071357.15698.JeLlyFish.software@gmx.net"
type="cite">
<pre wrap=""></pre>
<blockquote type="cite">
<pre wrap="">and if you go single-threaded you have to provide the main loop
hooks).
</pre>
</blockquote>
<pre wrap=""><!---->
Do I? I always thought a timer is more comparable to an interrupt or
signal than a polling loop.
</pre>
</blockquote>
In Delphi this is done by system messages, so no permanent polling
(spinning) but using a wait for message Windows API. I don't know how
this is done in Kylix or Lazarus/Linux.<br>
<br>
<blockquote cite="mid200611071357.15698.JeLlyFish.software@gmx.net"
type="cite">
<pre wrap="">
Well, for me it would have saved me some time which I wasted in creating
threads that implement "timing events" by simply sleeping for a
particular time. </pre>
</blockquote>
IMHO this should be done following the Delphi paradigms to be nice to
Delphi users coming over to FCP (only enhancement allowed). Of course
Lazarus does this, but IMHO it would be great to have this in a system
without a GUI, too.<br>
<br>
-Michael<br>
</body>
</html>