[pygtk] Downloading a file without locking the GUI
John Stowers
john.stowers.lists at gmail.com
Thu Oct 2 03:48:14 WST 2008
On Wed, 2008-10-01 at 20:16 +0200, Timo wrote:
> 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.
Please post your code so we can take a look.
>
> 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...
Did you check out the examples at the link I sent you?
John
>
> Thanks,
> Timo
>
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
More information about the pygtk
mailing list