Ionutz Borcoman wrote:
Hi,
I am trying to use threads and PyGTK together (under M$ Windows) with no success. I have attached the small program to this e-mail.
Am I doing something wrong ? Or is the pygtk not working with threads on M$Win ?
I have python 2.3.2, pytgk 2.0.0 and gtk 2.2.4.1.
TIA,
Ionutz
You need to call gtk.threads_init() and gtk.threads_enter() at the start of your program, and then call gtk.threads_leave() at the end (after gtk.main()). See here for more information:
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Threads.html
Thanx. My example worked with this small modification:
if __name__ == "__main__":
gtk.threads_init()
gtk.threads_enter()
test = Test()
test.main()
gtk.threads_leave()Nothing else needed. Cool.
I was also been able to do what I've wanted with the idle event and no threads. Now I am wondering what's better to use: idle events or threads ? Any recommendations ?
Ionutz
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
