[pygtk] Application responsiveness problem

John (J5) Palmieri johnp at redhat.com
Sat Mar 26 21:04:54 WST 2005


On Sat, 2005-03-26 at 06:46 -0600, Skip Montanaro wrote:
>     László> I want to make my application very responsive under high load.
>     ...
>     László> As you can see, I want to pulse a progress bar while a long
>     László> (computationally or I/O intensive) operation is running.  I
>     László> started a separate thread for it.
> 
> I could be wrong (never used threads with gtk), but don't you have some sort
> of gtk thread initialization function(s) to call?  See if something in
> section 20 of the PyGTK FAQ leads to a solution:
> 
>     http://www.async.com.br/faq/pygtk/index.py?req=index

gtk.gdk.threads_init()

also you can update the progress bar from you thread by calling these
two methods to lock the main thread:
 
gtk.gdk.threads_enter()
<gui update code here>
gtk.gdk.threads_leave()


-- 
J5



More information about the pygtk mailing list