Re: Progressbar



you're quite welcome ..... I've gotten a lot of help myself over the years from these lists, and it's nice to give something back occasionally ... especially when I just figured it out myself a few months ago :-)

Sandra Derbring wrote:
Thank you, this worked fine for me!

2008/5/19 Gorshkov <listsubscriptions oghma on ca <mailto:listsubscriptions oghma on ca>>:

    Sandra Derbring wrote:

        Hello,

        I have a problem with a progressbar. I want, for every file I
        look into, for the bar to show some progress, so that while you
        wait for the program to finish, the whole time can see the bar
        moving. When I implement it, all that happens is that the bar
        gets filled first after the program's finished. How do I make it
        show during the process?

        self.progressbar = gtk.ProgressBar()
        self.progressbar.show()

        self.step = 1/len(list)

        for file in list:
             self.x += self.step
             #do smth with file
             self.progressbar.set_fraction(self.x)



           gtk_progress_bar_set_fraction(pb, dpercent);
           gtk_progress_bar_set_text(pb, "Your text here");
           while (gtk_events_pending())
                   gtk_main_iteration();



    what you're missing is to force the updates to occur AT THE TIME,
    and not have them sit in the queue untill you're finished.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]