[pygtk] Downloading a file without locking the GUI

Timo timovwb at gmail.com
Sat Oct 4 23:24:24 WST 2008


Steve McClure schreef:
>
> If you just wanted progress you could use a reporthook function passed 
> to urlretrieve
Thanks, that looks really good!


> that would update the UI then
>
>     while gtk.events_pending():
>         gtk.mainiteration(False)
>
> to update the UI. That should make your UI responsive to the user to 
> and you just have to be careful that you don't call mainiteration, or 
> mainloop, from multiple places.  
I came across this a couple of times, but also didn't get it to work 
with this. But will look for some examples again then.

> Keep in mind that my application is so old that I use 1.x so the 
> programming model, or just names, might have changed in 2.x.
>
If I'm correct, it's gtk.main_iteration() now.

Timo



More information about the pygtk mailing list