[pygtk] pyGTK, Windows and threads
Dave Aitel
dave at immunityinc.com
Mon Oct 29 23:16:32 WST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
We always use threads_init in our Windows version (as in the Linux
version) of CANVAS. To me it sounds like you missed a spot and there's
still a non-main thread calling GTK routines.
Have you tried managing your own queue of "GTK things to do" rather
than using idle_add?
- -dave
Matías Alejandro Torres wrote:
> 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.
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHJeuKB8JNm+PA+iURAvUUAKCKhoofZ9LgjAoUSzm6Q7v4E5ok/wCghMuR
CjKRK9netVIZzd7D5Q/o28Q=
=qxOM
-----END PGP SIGNATURE-----
More information about the pygtk
mailing list