On Fri, 2005-02-11 at 16:59 -0500, Tom Copeland wrote:
> On Wed, 2005-02-09 at 23:16, Tom Copeland wrote:
> > On Wed, 2005-02-09 at 22:46, Tom Copeland wrote:
> > > I've got a small C socket client that's reading data (some URLs and
> > > whatnot) from a GIOChannel  and opening new GtkWindows, each containing
> > > a GtkMozEmbed object. 
> > 
> > It looks like both Reinhard and Christopher are suggesting using
> > gtk_idle_add() to communicate with the main GTK event loop rather than
> > munging around with the thread locking calls.  I'll try gtk_idle_add()
> > unless someone else has other suggestions...
> 
> This seems to do the trick:
> 
> Open a client socket 
> Create a GAsyncQueue as an event pipeline 
> Create a GIOChannel that listens for G_IO_IN on the socket.  Its
> callback function should read in the data, creates events, and drops
> them into the queue
> Create a GSource that reads events from the queue and dispatches them

A further note on this... rather than doing the GSource thing that
watches the queue, it's simpler to just do a g_idle_add() that checks
the queue and handles any events that have arrived.  

I'dd write this up in an article if I thought anyone was interested
enough in GtkMozEmbed to publish it :-)

Yours,

Tom


_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to