(very) newbie question: how request a redraw




I am working on my first significant Gtk-based application, which uses
the gtkglarea widget and will involve some animation.  My only
previous experience with this kind of programming was done with GLUT
(a simple toolkit for writing OpenGL applications).  In a GLUT version
of the program, I would use a timer callback to update the data
describing the scene to be drawn, and then I would tell the window to
redraw itself using the function

  glutPostRedisplay();

so that GLUT would callback-to my drawing function to redraw the
scene.

Assuming this is better than actually doing the OpenGL calls within
the timer function, how would I do the equivalent in Gtk?  Would I
send an GtkWidget::expose event to gtkglarea widget?  If so, how do I
do this (I haven't sent any Gtk signals yet)?  Is there some code in a
relevant application that I could study?

Thanks!

-- 
Christopher Lee
http://www.cs.cmu.edu/~chrislee
chrislee@ri.cmu.edu



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