Hi,

I have a need to stall my program for about 10 seconds before continuing.  One way would be to simply use the time.sleep(10) function. I feel a more user friendly way would be to display a progress bar that runs for about 10 seconds.  I hacked the example found in  the pygtk tutorial: http://www.pygtk.org/pygtk2tutorial/examples/progressbar.py for such a purpose.  So lets say my program looks as follows:

---------------------------------------------------------
import progressbar

.......
{a bunch of commands}
.......

print "Before Progress Bar ..."
progressbar.ProgressBar()
print "After progress Bar ..."

........
{more commands}
.........
-------------------------------------------------------------

The problem is the program continues to execute in parallel to the progress bar (in other words the message "After progress bar ..." appears while the progress bar is still running.  I would like the message "after progress bar..." to only appear once the progress bar has been destroyed.

I eventually fixed the problem by connecting to the destroy signal:

   prog=progressbar.ProgressBar()
   prog.window.connect("destroy",RunEND)

Thus the function RunEND is executed once the progressbar is destroyed and the continuation of my program is placed in RunEND.

Is there a more elegant way of accomplishing the same? 

Thanks for your help!

Paul




_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to