Problem in updating progress bar



What could be the reason for using gtk_events_pending() and gtk_main_iteration() in the following code snippet:


for( gflt=0; gflt<=1;  ){
       gtk_progress_bar_update( (GtkProgressBar*)pbar, gflt );
       //update
       while (gtk_events_pending ())
           gtk_main_iteration ();
       gflt += 0.1;
       sleep(1);
      if ( gflt > 1 ) break;
   }

why the code cannot update the progressbar without these two functions? I saw the API but still it is not clear to me.

Thanks.

--AD

_________________________________________________________________
Fashion, food, romance in Sympatico / MSN Lifestyle http://lifestyle.sympatico.msn.ca/Home/




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