Re: [gtk-list] Re: Gtk/GLib timeouts and pthreads



On Sat, 20 Nov 1999, Paul Barton-Davis wrote:

> i am not an expert on this, but i think you will find that using:
> 
> >  while(gtk_events_pending()) gtk_main_iteration();
> 
> will never, ever cause timeouts (or idle functions) to be executed.

I solved the problem switching this line above by an usleep:

pthread_create()

while(!thread_done) {
   update spinner
   usleep(90000) /* 90000 microsecs = 90 e-3 sec*/
}

pthread_join()

and making the update spinner routine call the GDK painting functions
directly instead of queuing repaint events.

Thanks to those who posted comments on the question.

-- Felipe



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