[Lazarus] Windows.PostMessage vs Application.QueueAsyncCall
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Tue Mar 18 14:13:22 CET 2014
Michael Schnell schrieb:
> On 03/18/2014 09:57 AM, Hans-Peter Diettrich wrote:
>>
>> The LCL is based on the message queue, regardless of any OS or
>> widgetset. PostMessage is part of the message queue.
> Yep. (Even though I prefer the term "Event Queue" as the queued
> information this is not necessarily similar to Windowish "Messages".)
The message queue is not restricted to events.
> In fact there is an Event Queue in the RTL (that is used e.g. for
> TThread.xxx based events) and an additional Event Queue that handles
> events based on the GUI the LCL binds to (here the Events are "Messages"
> if the GUI is Windows). With Windows, the Queue itself is implemented in
> the OS and only _used_ in the LCL, while with any Linux GUIs, the queue
> is implemented in the LCL and is fed by Events _generated_ by the GUI
> (no idea about Mac).
Yes, events fit nicely into a message queue.
The events, created by the window manager and other OS services, must
find their way to the component and user handlers, what in most
widgetsets is done by calling dedicated callback functions. The
parameter lists and events must be unified, so that the LCL can provide
a common interface for all user supplied handlers. What's so bad in
using the Windows messages for that purpose, and what would be your
other way of doing that?
> Now, the GUI-attaching "Widget Type"
> implementations in the LCL merge the events of both queues, while the
> not GUI-attaching Widget types currently even ignore the RTL based queue.
What's "GUI-attaching"?
>> You didn't answer my question: which other event handling model would
>> you prefer, for use on any target and widgetset?
> Because I don't understand the your meaning here.
Do you understand events at all, their implementation and handling?
[...]
> - I don't understand what you intend by mentioning the "mouse input and
> painting" issue.
Then try to explain how e.g. a key or button press event is processed in
your model.
DoDi
More information about the Lazarus
mailing list