[pygtk] pyGTK, Windows and threads

Matí­as Alejandro Torres torresmat at gmail.com
Mon Oct 29 13:41:12 WST 2007


Hi,

I'm building an application that uses threads and it used to lock up in 
windows when the function gtk.gdk.threads_init was called before 
gtk.main. In the application drawing from threads is done by adding idle 
functions to the main loop using gobject.idle_add.

I've been reading 
(http://faq.pygtk.org/index.py?req=show&file=faq20.006.htp) and it says 
that the threads_init method should be only used when more than one 
thread draws directly to the GUI using the gtk.* methods. After reading 
this I stop calling gtk.gdk.threads_init and the application is now 
working well.... I thought that using gtk.gdk.threads_init whas 
mandatory when using threads, is my application going to randomly crash 
if i don't use it?

Thanks in advance, Matias.


More information about the pygtk mailing list