Q: Redraw requests
- From: chrislee lavash ius cs cmu edu
- To: gtk-list redhat com
- Subject: Q: Redraw requests
- Date: 31 Jul 1998 10:34:57 -0400
I recently sent a question to this list about how to indicate that a
window needed to be redrawn (for animation in a gtkglarea window). I
didn't hear a response, so I went for the naive solution and just ran
the redrawing code at each time-step (I am using a timeout-callback at
10Hz). When I tried to draw something which couldn't be rendered that
quickly, however, this method caused serious problems. The program
spent all its time rendering and never got around to processing the
necessary events.
I mucked around gtkwidget.c a bit and found the function
"gtk_widget_queue_draw()". I tried calling this within the
timeout-callback function instead of directly calling my drawing code,
and this seemed to fix the problem.
Is this the proper way to request a redraw "at the next appropriate
time", or should I be doing things differently?
--
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]