prograss bar question



Hi all:
      I'm writing a project using the gtk+-2.0, as I trying to use the progress bar to present the progress of my program.
I have a question with the following code seg...
Why the execution between my main program and update progress bar are not concurrent!!???

every time in execution, the progress bar update after my main program finished!!!


gboolean    button10_callback_1(gpointer data){

    //Execute my main program here!!!!!
    return FALSE;
}

void
on_button10_clicked                    (GtkButton       *button,
                                        gpointer         user_data)
{

    GtkWidget *progbar;
    progbar = lookup_widget(GTK_WIDGET(user_data),"progressbar1");
    gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progbar), 0);
    gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progbar), "0%");
    timer = g_timeout_add (100,progbar_func,progbar);
     while (gtk_events_pending())
         gtk_main_iteration();
   


    g_idle_add_full(0,button10_callback_1,NULL,NULL);

}

Can anyone help me!!!Thanks very much!!!!

Dave




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