Driving an animation in a widget



I'm writing a Mozilla plug-in which includes a GTK widget. The widget is
an OpenGL visualization using GtkGLExt. The animation is driven using
the following sequence:

     1. one-shot timeout callback (added with g_timeout_add) initiates
        update of widget state
     2. gtk_widget_queue_draw(my_widget);
     3. while (gtk_events_pending()) { gtk_main_iteration(); }
     4. goto 1

This is interacting badly with Mozilla. I get a crash on exit because
the widget may be destroyed in the middle of processing the timeout
callback.

What I need is the ability to have a user-defined event that can simply
fall on the floor if the widget has been destroyed. Does GTK provide
something like this?

-- 
Braden McDaniel                           e-mail: <braden endoframe com>
<http://endoframe.com>                    Jabber: <braden jabber org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]