On 06/26/2014 01:47 PM, Mattias Gaertner wrote:
I can rephrase it:
The LCL Application.QueueAsyncCalls can be called by any thread, and
executes the calls, when the main thread calls
Application.ProcessMessages. Therefore the calls are executed by the
main thread.
Of course I do know this. But my goal is that these Events are executed without the user needing to call Application.ProcessMessages. (IMHO this is how decent Object Pascal Applications are supposed to work.)

I implemented it in My TApplication class and it does work perfectly (using the svn-version of the fpc rtl).
You don't need TThread.Queue for that.
To do an _active_ application you need an event queue for that purpose. The GUI based Widget Types use their own Event Queue implementations in the LCL for this. (AFAIK) NoGUI does not have an Event Queue in the LCL (and I don't want to add one). Hence it can't "automatically" (without a main loop visible to the user) do Main Thread Events (such as fired by TTimer and QueueAsyncCall().

So the only EventQueue I (want to) have in my ActiveNoGUI Application is the one provided by the fpc RTL. And same is integrated with the TThread implementation I need to (and am happy to) use same. But this is only possible since the appearance of TThread.Queue (which is compatible even to rather old Delphi versions and some time ago has been done due to my request) .

-Michael

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to