Getting Progress bar to display



Hi-

I'm trying to do the following (forgive the Python)

myprogressbar.show()
longfunc()

but the progress bar does not fully get shown until after the longfunc.
So I tried

myprogressbar.show()
while gtk.events_pending() != 0:
       gtk.mainiteration(gtk.TRUE)
longfunc()
        
but apparently I need to process for events. So I resorted to

myprogressbar.show()
for i in range(10000):  
      while gtk.events_pending() != 0:
        gtk.mainiteration(gtk.TRUE)
longfunc()

and this worked.

What is the correct way to do this? (I can't process the gtk signals from 
within longfunc)

Mathew

      






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