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
- gboolean
- progress_update (gint counter)
- {
- ProgressData *pdata = (ProgressData *)g_run->progress_bar_data;
- g_return_val_if_fail(pdata, TRUE);
- gdouble total = counter / 54.0;
- g_printf("TOTAL = %lf\n", total);
- // Calculate the value of the progress bar using the
- // value range set in the adjustment object
- total = total * 100;
- g_printf("New Total = %lf\n", total);
- gchar *message = g_strdup_printf ("%.0f%% Complete", total);
- if (pdata->pbar)
- {
- gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pdata->pbar), total);
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR (pdata->pbar), message);
- }
- g_free(message);
- // As this is a timeout function, return TRUE so that it
- // continues to get called
- if ( 1.00 == gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR (pdata->pbar)))
- {
- gtk_widget_hide_all(pdata->window);
- destroy_progress( pdata->window, pdata);
- }
- return TRUE;
- }
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.
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.