[pygtk] Downloading a file without locking the GUI
Timo
timovwb at gmail.com
Thu Oct 2 02:16:48 WST 2008
Thomas Guettler schreef:
> Timo schrieb:
>> I want to download a file by pressing a button in my GUI, all works
>> so that's okay. Offcourse my GUI locks up during the download.
>> I tried some things like writing a thread and using gobject.idle_add.
>> But none of these worked.
>> Anyone can point me out to some kind of example or tutorial?
>>
>>
> Hi,
>
> You could use PixbufLoader, non-blocking IO and idle_add. This
> solution works without
> threads. I try to avoid them.
>
> Sorry, that's not an example or tutorial, but if you found idle_add,
> you will get this done, too.
>
> HTH,
> Thomas
>
I don't get the pixbufloader thing, since I don't download images. But
maybe I'm just missing something.
Well, after searching and trying again, still no progress. I guess I'm
just missing something.
Here's what I want to do, maybe someone has an idea how to do this:
def buttonclicked(widget):
urllib.urlretrieve(url, downloadpath)
I was also thinking about adding a progressbar during download, but if I
can't even get this done...
Thanks,
Timo
More information about the pygtk
mailing list