[pygtk] change progressbar fraction

Nikos Kouremenos kourem at gmail.com
Sat Jan 14 19:05:57 WST 2006


read the FAQ on progressbar.

On 1/14/06, Arie Timmerman <arietimmerman at gmail.com> wrote:
> I'm trying to make a progressbar for downloading a file. The progressbar
> works doesn't work perfect. It only shows when it is ready
> (ProgressBar.get_fraction == 1). How can i change this.
>
> /while 1:
>             data = website.read(1024)
>             total = total + len(data)
>             fractie = round(total/filesize,1)
>             print self.progressbar.get_fraction() #this seems to be OK.
> The result: 0.0 0.0 0.0 0.0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.2 0.2
> and so on.
>             self.progressbar.set_fraction(fractie) # this doesn't change
> the progresbar, i don't see it. The 'visual part' doesn't change. The
> get_fraction() does.
>             file.write(data)
>             if not data:
>                 print "file downloaded"
>                 break//
>
> How can i make a working progressbar?
> /
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>


--
Nikos Kouremenos | Jabber ID: nkour at jabber.org | http://members.hellug.gr/nkour


More information about the pygtk mailing list