nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: Re: Timer API.
From: Chris Johns
Date: Thu, 03 Feb 2000 08:28:31 +1100

Greg Haerr wrote:
> 
> : I need to have some timers in my application.
> :
> : What is the API ?
> :
> : Does anyone have an example ?
> 
> The timer API is SetTimer() and KillTimer(), which sends
> a WM_TIMER message to your window procedure.  I would
> prefer to add this, since it's a little tricky.  I've been meaning to
> add it for some time.
> 

Could you please provide the extact detail for me to work with eg
prototypes, message number etc. ?

It would be nice to be able to pass a pointer to a timer struct and
LPARAM of the message.

> Basically, we will use the select() timeout value in order to delay for
> a next-timeout minimum value, then, if a timer is expiring, send a WM_TIMER
> message and remove it from the queue.
> 

The select side of things is ok. A delta list looks like a good fit. You
need to search the list to insert a timer, how-ever the main loop is
easy (sort of), and the kill timer is also easy (double linked list).

> I can probably get this in quickly, but you're welcome to take
> a hack at it.
> 

I need this feature ASAP so I am happy to do it.

-- 
 Chris Johns, mailto:ccj@acm.org

nanogui@linuxhacker.org