>       BTW, in the code I posted recently, I added a call to 
> remove_timeout()
>       in the timer's callback.
> 
>       I've always done this because my reading of the docs 
> don't explicitly
>       say remove_timeout() doesn't need to be called, and due to the
>       existence of 'repeat_timeout()', it seemed to imply FLTK keeps
>       track of the first timeout for repeat_timeout() to use, 
> which meant
>       to me that one should call remove_timeout() if repeat 
> isn't going
>       to be used.

IIRC (and I may well be wrong) the last time I looked at the code,
repeat_timeout and add_timeout are basically the same thing - the
difference (on some platforms, and I can't recall which) is that
repeat_timeout attempts to take account of the time spent in the
callback, so that a repeating timeout will tick at the requested rate,
and not be slightly slower... However, on some platforms repeat_timeout
*is* add_timeout.

>       Docs should on add_timeout() should maybe clarify if 
> remove_timeout()
>       should be called in the callback if repeat_timeout() 
> isn't going to be
>       used.

I *think* the remove is useful if you want to cancel a still-running
timeout, but I do not think it is required to call it for an expired
timeout. However, calling it is harmless I believe, and probably Good
Form as it balances the add...



SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to