On Sat, 2003-10-04 at 23:15, Liquid wrote:
> Hi all,
>
> I really can't understand how to start the progress bar when I press a button.
> Put the bar is really easy, but after a lot of tentatives I couldn't find the
> way to start the bar.
>
> Here I put the prograss bar in the window and it work fine
>
> progressbar = gtk.ProgressBar(adjustment=None)
> progressbar.set_text('work in progress')
> table.attach(progressbar, 2, 4, 12, 13)
> progressbar.show()
>
> Here is the button
>
> button = gtk.Button(label='Make & Install')
> button.connect("clicked", self.make) #make & install
> button.connect("clicked", self.pulse)
> table.attach(button, 1, 3, 4, 5)
> button.show()
>
> I've tried in this way (of course wrong probably)
>
> def pulse(self, widget, data=None):
> if button.connect():
> self.progressbar.pulse()
> else:
> self.progressbar.set_fraction(0.0)
I think you may be misunderstanding what pulse() does. It only moves the
progress bar indicator once. During a time-consuming process, you would
periodically call the pulse() method to force a small change in the
progress bar and thus it will look like it is moving during the
operation.
If you are trying to make the progress bar indicator move backwards and
forwards after you push the button, you will need to call pulse() many
times -- probably with a small delay in between so that it doesn't move
ridiculously fast.
Cheers,
Malcolm
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/