[pygtk] Downloading a file without locking the GUI

Steve McClure smcclure at racemi.com
Mon Oct 6 00:20:57 WST 2008


On Oct 4, 2008, at 11:24 AM, Timo wrote:

> 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.

Usually because whatever you are trying to do, in this case a long  
download, doesn't allow you to get back to the event loop.

>
>
>> 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.

That sounds right.

>
>
> Timo
>
>

--
Steve McClure
smcclure at racemi.com



More information about the pygtk mailing list