Re: [gtk-list] Re: gtk_main() and foreign event loops



On Wed, 26 Jan 2000, Erik Mouw wrote:

> g_io_add_watch() allows you to watch the status of certain fd's. Here is
> some documentation:
> 
>   http://developer.gnome.org/doc/API/glib/glib-io-channels.html
> 
> (looks to me like the underlying mechanism for gdk_input_add())
> 
> Now if Orbix/ORBACUS is able to tell which socket they're using to listen
> to incoming requests, you could set a watch on that socket. So if you add
> a watch on the condition G_IO_IN, your function will be called as soon as
> there is incoming data available. In your function you just process a
> couple of steps of the Orbix/ORBACUS event loop.
> 

Having answered this question on irc.gimp.org too many times to mention I
finally threw togeather some sample code for adding a file descriptor to
the gtk event loop.  You'll find it at

http://www.uq.edu.au/~cmamuys/source_downloads/inputtest.tgz
http://www.uq.edu.au/~cmamuys/source_downloads/sockettest.tgz

The first uses a pipe, the second a socket (too many people were
complaining they weren't able to generalise from a pipe to a socket :(.

Andrae

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrae Muys <andrae@humbug.org.au> "Never ascribe to malice that which is
System Programmer                   adequately explained by incompetence."
The Centre for Magnetic Resonance                   -Napoleon Bonaparte
The University of Queensland



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