Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Paste Description for Unable to update the Progress ba

Hi I am unable to update GUI of Progress bar. Any solution.

Unable to update the Progress ba
Wednesday, January 9th, 2008 at 12:29:37pm UTC 

  1. gboolean
  2. progress_update (gint counter)
  3. {
  4.   ProgressData *pdata = (ProgressData *)g_run->progress_bar_data;
  5.   g_return_val_if_fail(pdata, TRUE);       
  6.    
  7.   gdouble total = counter / 54.0;       
  8.   g_printf("TOTAL = %lf\n", total);   
  9.  
  10.   // Calculate the value of the progress bar using the
  11.   //  value range set in the adjustment object  
  12.  
  13.   total = total * 100
  14.   g_printf("New Total = %lf\n", total);
  15.  
  16.   gchar *message = g_strdup_printf ("%.0f%% Complete", total);
  17.   if (pdata->pbar)
  18.     {
  19.         gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pdata->pbar), total);
  20.         gtk_progress_bar_set_text (GTK_PROGRESS_BAR (pdata->pbar), message);   
  21.     }   
  22.    g_free(message);          
  23.   // As this is a timeout function, return TRUE so that it
  24.   // continues to get called
  25.   if ( 1.00 == gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR (pdata->pbar)))
  26.    {           
  27.         gtk_widget_hide_all(pdata->window);
  28.         destroy_progress( pdata->window, pdata);       
  29.    }            
  30.   return TRUE; 
  31. }

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right
worth-right