Donn wrote:
Hi,
I want to try and draw a series of cairo shapes in a loop that does other
stuff like:
while True:
canvas.draw()
updateStuff()
checkStuff()
How do I fit this concept together with the gtk.main() that seems to stop
there? Am I looking at some kind of timeout() command?
\d
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
You can manually implement a nested event loop.
Using the simple function
def flush_events():
# Updates bounding boxes, among others.
while gtk.events_pending():
gtk.main_iteration()
your loop could be
while True:
draw()
flush_events()
as long as draw() does not block.
-- Mike
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/