update a progress bar from a thread



hi

i upgrade a progress bar from the body of a thread with the following code:

void *body_monitor_avanzamento(void *args){
 monitor_avanzamento *m=(monitor_avanzamento *)args;


 float avanzamento=0.0;

 while(avanzamento<1){

   avanzamento=(float)*(m->db->counter_shared)/(float)m->tot_pacchetti;
   gtk_progress_bar_set_fraction ((GtkProgressBar
*)m->scroll_avanzamento_simulazione,avanzamento);
   gtk_widget_show(m->scroll_avanzamento_simulazione);

   sleep(1);
 }
}

it works, but i can see the progress bar update only when i go with
the mouse over the progress bar, maybe i have to call another update
function?

i've also tried to make a  gtk_widget_show_all of the windows, but
without any result...

thanks nik



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