On Mon, 2004-08-23 at 06:30, Le Boulanger Yann wrote:
> Le Boulanger Yann wrote:
> > Hi all,
> >
> > I've a probleme with pygtk used in a thread.
> > My application can be presented like that : I have a main thread that do
> > some things and that can lunch plugins. Plugins are lunched in a new
> > thread thanks to threading module.
> > one of these plugins is a pygtk plugin :
> > it starts gtk with gtk.gdk.threads_init(), gtk.main(), show windows, etc.
> > Now the probleme is when I want to close this plugin : I close the main
> > window, then do a gtk.main_quit(), but the windows opened don't close.
> > GTK is no more active : I cannot do anything in them, but they are
> > always here ...
> > Is it my Job to close them all before the gtk.main_quit() ?
> >
> > Asterix
>
> I come back with the same pb not resolved, but this time I have a little
> program that shows the problem :
> If you want to try it, lAunch ( ;) ) core.py : it prints "core" every 2
> seconds and launch a thread that use GTK and open 2 windows. When we
> close the main one (named Gajim), the other doesn't close :(
>
> Any help would be greatly appreciated.
Your main program doesn't have any way to exit. The thread running the
GUI quits properly since it handles the destroy signal, but you need
your main program to occasionally to a thr.join() to see if the thread
has exited, then exit itself. Assuming that is the behavior you want.
Something like this:
thr = GajimThread('gt')
thr.start()
while thr.isAlive()
thr.join(timeout=0.1)
time.sleep(2)
print "core"
>
> Asterix
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
--
Steve McClure <[EMAIL PROTECTED]>
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/