[lazarus] timer on win32

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Nov 18 09:11:45 EST 2002


On Mon, 18 Nov 2002 00:18:14 +0100
"Vincent Snijders" <vslist at zonnet.nl> wrote:

> Hi,
> 
> As somebody may have noticed, at the moment timers are not working in the
> win32 widgetset. Since this seemed a relatively easy and confined problem,
> I decided to look into it.
> 
> I think the problem is caused by the fact that the settimer function isn't
> called with a real window handle, but with the pointer to the (LCL-)timer
> object. I don't think we can / should / may put any window handle in the
> LCL, so calling it with a window handle is out of the question.

Agreed.


> I think the procedures SetTimer and KillTimer should be removed from
> LCLLinux, because they don't offer a compabitible functionality as in the
> windows unit.
> 
> CustomTimer should then make direct calls to the interfaceobject. Maybe we
> can change the names to CreateTimer and DestroyTimer.
> 
> What do you think of this?

Makes sense.


> I am willing to implement these changes.

ok


> One other question:
> In the interfacebase both DoEvents and HandleEvents are declared. In the
> GTK interface only HandleEvents is implemented. What is the difference
> between DoEvents and HandleEvents? 

I'm not sure, it looks win32 specific. Delphi6 does not use it.


> Why is only one needed in the GTK interface?

To handle a message queue you need only three functions:
One that tells if message is waiting, one that handles all waiting messages
and one that waits till a message arrives.
I don't know, why win32 has two different functions to handle the messages.
Maybe someone with win32 knowledge knows why.


> Does that mean we can remove DoEvents from the interfaceBase?

Since it is not used and it's not needed for Delphi compatibility: yes.


Mattias






More information about the Lazarus mailing list