FAQ Index - Search - Recent Changes - Everything - Add entry

===================================================================
RCS file: RCS/faq20.006.htp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- faq20.006.htp	2003/05/18 13:50:39	1.3
+++ faq20.006.htp	2003/05/18 19:03:45	1.4
@@ -1,5 +1,5 @@
 Title: 20.6. I am using a separate thread to run my code, but the UI is still unresponsive.
-Last-Changed-Date: Sun May 18 10:50:39 2003
+Last-Changed-Date: Sun May 18 16:03:45 2003
 Last-Changed-Author: Christian Reis
 Last-Changed-Email: kiko@async.com.br
 Last-Changed-Remote-Host: 200-148-103-52.dsl.telesp.net.br
@@ -11,7 +11,11 @@
 
 at startup. Failing to do this will make PyGTK never release the python threading lock. At least Debian's packages are compiled properly, so it's a matter of using that call.
 
-John K. Luebs reminds you: *don't forget gtk.threads_enter() and gtk.threads_leave()* when accessing gtk code if you want your application to actually work threaded.
+John K. Luebs reminds you: *don't forget gtk.threads_enter() and gtk.threads_leave()* around mainloop when accessing gtk code if you want your application to actually work threaded:
+
+ gtk.threads_enter()
+ gtk.mainloop()
+ gtk.threads_leave()
 
 It's been suggested that you should really make calls using idle_add() from other threads, to make sure that all PyGTK calls run in the thread where the mainloop is running (idle_add()ed calls are processed by the mainloop itself). While not strictly necessary (I think) it should probably avoid some hidden bugs.
 

PyGTK FAQ Wizard | PyGTK Homepage | Feedback to faq at pygtk.org