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
>> That's not the only way. You can use gobject.timeout_add() to arrange
>> for a function to be called at regular intervals.
Donn> Thanks again Greg, simplicity to the rescue :)
Take a look at gobject.idle_add() (perform a computation when the process is
otherwise idle) and gobject.i
> That's not the only way. You can use gobject.timeout_add()
> to arrange for a function to be called at regular intervals.
> That function can then do whatever the body of your while
> loop would have done.
>
Thanks again Greg, simplicity to the rescue :)
\d
__
Donn wrote:
you have to do background work like this one, you need some kind of
multithreading.
Blimey. I have managed to get this far in life without ever looking at
threads. I suppose it's high time ...
That's not the only way. You can use gobject.timeout_add()
to arrange for a function t
> you have to do background work like this one, you need some kind of
> multithreading.
>
Blimey. I have managed to get this far in life without ever looking at
threads. I suppose it's high time ...
Thanks for the link.
\d
___
pygtk mailing list pygtk
The GTK mainloop has to deal with user's events, so you can't use it
for that kind of stuff since you would block the events' handler. If
you have to do background work like this one, you need some kind of
multithreading.
See http://faq.pygtk.org (Sec. 20)
On 10/28/07, Donn <[EMAIL PROTECTED]> wr
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