Re: Progressbar

Sandra Derbring wrote:

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.step = 1/len(list)

for file in list:
      self.x += self.step
      #do smth with file

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

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]