How can deal with the warning?



Hi,
    I have just begun to study gtk.
    I have the following warning when I use the progressbar to do some test.
    
        GLib-WARNING ** : g_main_interate(): main loop already active in another thread
    
    I search the FAQ,but don't find the answer.If I should not use the thread of c, but
    of glibc? Help, thank you very much!
        Regards!
    Hzeng
--------------------------------------------------------------------------------------------
    my programe is builded by glade, this is the callbacks.c:
    
        void *pbar_update(void * user_data)
        {
             static int i;

             while(i<=100)
             {
                  gtk_progress_set_value(GTK_PROGRESS(user_data),i++);
                  while(gtk_events_pending())
                       gtk_main_iteration();
             }
        }

        void
        on_window1_destroy                     (GtkObject       *object,
                                                gpointer         user_data)
        {
             gtk_main_quit();
        }

        void 
        on_window1_show          (GtkObject  *object,
                                  gpointer user_data)
        {
             pthread_t thread;
             pthread_create(&thread,NULL,pbar_update,(void *)user_data);
        }
    


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