On 18.08.2010, at 12:44, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>
>> Would there be any issues to be expected with setting
>> up a timer callback inside the draw() event? This would
>> allow the GIF object to 'damage' itself for redrawing
>> whenever it's time for the next frame to be displayed.
>
> I think calling add_timeout (or maybe better repeat_timeout) from within
> the draw() method would be OK - though I can't recall ever having done
> it...

I wouldn't do it in draw(), because draw() can be called at any time
when there's a need to (re)draw, such as resizing and show()ing
after hide() and so on...

I recommend to start the timer once the image is loaded and to call 
repeat_timeout in the timer callback. The only other thing(s) the
timer callback has to do would be to increment (and wrap to 0) the
image index and call redraw(). There would also be a need for a
destructor to remove the timer. The draw() method would have to draw
the correct image by index.

Sounds all fairly easy if you know how to load and display one
particular picture of the animated gif image set.

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

Reply via email to