Start Progress After User Has Entered Info/Data



Dear List,

I have studied the example program for creating a progress bar and tried some variations. For my application, 
the user must set a few parameters and open a few data files. I would like to have the progress bar start up 
after that. For whatever reason, although I can see the outline of the progress bar, I cannot get it start or 
write text into it with a callback function that is executed when the user clicks on "start".

The function is something like this:


static void start_progress_and_calculations( GtkWidget *w,
                                                                                                              
  gpointer   data ){
         pdata->timer = g_timeout_add (100, calculate_bspc, pdata);

         calculate_lots_of_neat_stuff(pdata);
}




 calculate_lots_of_neat_stuff in turn has some code such as

gtk_progress_bar_set_text (GTK_PROGRESS_BAR (pdata->pbar), "Input data");
  
        gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pdata->pbar), 0.9);


...


What am I doing wrong? Sorry if these are dumb questions, it's my first GTK app...

gruss, Peter



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