Re: Providing gtk_main() with asynchronous data



On Sun, 2005-07-31 at 15:44 -0600, Pat Mahoney wrote:
(not subscribed; please CC replies)

I'm trying to find a way to provide my mainloop with asynchronous data
from a thread.  I have read this:

http://mail.gnome.org/archives/gtk-app-devel-list/2004-July/msg00181.html

which describes how to use a GAsyncQueue and GSource to watch the queue
for available data (and to have the thread wake up the mainloop when data
is available).  A callback is run in the context of gtk_main when
data is available.  It works perfectly except for one show-stopper
problem:

Note that using a custom GSource here is perhaps overcomplicated. The
simplest method is:

 g_idle_add (function_to_call_in_main_thread, data_to_pass_to_function);
 
(Or use g_idle_add_full() if you want to prioritize the callback higher
than the default idle priority.)

Regards,
                                                Owen



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