[fpc-devel] TCustomApplication

Michael Van Canneyt michael at freepascal.org
Mon Aug 19 13:47:16 CEST 2013



On Mon, 19 Aug 2013, Michael Schnell wrote:

> On 08/19/2013 11:28 AM, Michael Van Canneyt wrote:
>> 
>> I am having a déjà vu :-)
> Yep.
> But at that time I (maybe completely erroneously) decided to do this as an 
> LCL Widget Type as I had extensions in mind that would fit just there (such 
> as stuff based on "ExtPascal" or "mse-ifi").
>
>> If memory serves me well, MSEGUI contains such an event loop descendent 
>> using a custom made mechanism.
> Of course. In fact I understand that any LCL Widget Type does this, too.
>
>> 
>> There is nothing magical about such an application. Basically, it watches 
>> one or more
>> file descriptors (object handles in windows-speak) for changes, using a 
>> timeout,
>> and triggers some event handler when something happens. It calls 
>> checksynchronize from time to time. That's it.
>> 
>> It should not take more than an hour to implement.
> In fact I do know this. If I would have a current practical project to do, I 
> of course would do this right away, but (as always) I am doing just 
> researching and groundwork for future projects.
>
> So - if I would start doing anything on that behalf - I would do something 
> with as wide reach as possible: providing (at least) all of  TTimer,

You may need to do ttimer if you need that.

> TThread.Synchronize, TThread,Queue, and Application.QueuAsnycCall, as well 
> for Linux and for Windows in a "ready to use" way (including documentation).

YOU DO NOT NEED TO DO THIS.

Just implement the loop and let it call CheckSynchronize at regular intervals.
All the rest will be done for you.

Michael.


More information about the fpc-devel mailing list