Re: [pygtk] gtk main loop alternatives

2007-10-29 Thread Michael Hohn
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

Re: [pygtk] gtk main loop alternatives

2007-10-28 Thread skip
>> 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

Re: [pygtk] gtk main loop alternatives

2007-10-28 Thread Donn
> 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 __

Re: [pygtk] gtk main loop alternatives

2007-10-28 Thread Greg Ewing
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

Re: [pygtk] gtk main loop alternatives

2007-10-28 Thread Donn
> 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

Re: [pygtk] gtk main loop alternatives

2007-10-28 Thread François Ingelrest
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

[pygtk] gtk main loop alternatives

2007-10-28 Thread Donn
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