gtkprogressbar update problems



Hello, here comes my problem:
i have a subroutine call evaluate() this subroutine is called after a
button press event. Ok in this subroutine i update the progressbar to be 0
with: gtk_progress_bar_update (GTK_PROGRESS_BAR(bar),0.0);
After that i set the Adjustment with the following code :


if (PQntuples (res) != 0)
    {
       adj->upper= PQntuples (res);  
       gtk_adjustment_changed(adj);   
    }
  else
    adj->upper = 1;
gtk_progress_set_adjustment (GTK_PROGRESS(progressbar),adj); 

And in a for(..;..;..) statement i do the following :

progress_adj=gtk_progress_get_value (GTK_PROGRESS (progressbar))+1;
    if (progress_adj > adj->upper)
      progress_adj = adj->lower; 
      printf("value %f\n",progress_adj);
      gtk_progress_set_value (GTK_PROGRESS (progressbar), progress_adj);
gtk_widget_show(progressbar);

The problem now is, that the value is changing by doing the loop but the
progress bar is updated only by exiting this subroutine what things must
be done to let it update in this loop correctly ??

Andreas Scherf
+--------------------------------------------+
I EMail    : scherfa@fh-trier.de             I  
I Homepage : http://www.fh-trier.de/~scherfa I
+--------------------------------------------+




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