Re: [pygtk] yet another threading question

2002-08-01 Thread Rob Brown-Bayliss

On Thu, 2002-08-01 at 16:46, Rob Brown-Bayliss wrote:
 Hi, I have been going of the archive for a while now and I cant seem to
 get this sorted.

My mail is down this morning, at least the recieving of mail so I don't
know if thhere have been any replys, but I got it sorted with:

def pending():
while gtk.events_pending():  
gtk.mainiteration(0)

then in mythread I add a pending() at the end of each for loop thats
adding rows to teh model for my treeview..  It's a shame that I saw that
in a mailatleast 5 times yesterday and didn't seem to register... More
coffee perhaps :o)

-- 

*
*  Rob Brown-Bayliss
*
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] yet another threading question

2002-07-31 Thread Rob Brown-Bayliss


Hi, I have been going of the archive for a while now and I cant seem to
get this sorted.

I have an app, it dynamically impotts modules depending on the users
actions, and some (one of these) include modules that try to use
threads.

the main py prog does this:

#!/usr/bin/env python2
import threading
import sys
import gnome.ui
import gtk
from GearBox import *

gtk.threads_init()
gtk.threads_enter()

if __name__ == '__main__':
app = GearBox()
gtk.mainloop()
gtk.threads_leave()

Now when I start teh module with the thread from teh main app the
gnome-system-monitor shows the thread, so it all looks good.  Then I
click on a ui button that askas the thread to update teh display (a tree
view) and teh whole UI freezes until it is done.

Argh! 

How do I get the thread to churn away updating teh view one row at a
time (the whole thing takes about 5 seconds)?  Is the problem that the
hole thing is in another module? 

Also, should I (can I) destroy the thread once the display is updated
and create a new one next tiem?  at the moment the thread just hangs
around waiting to be told to update the display.

Thanks

-- 

*
*  Rob Brown-Bayliss
*
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/