Re: [Basic Glib Questions/Help] Unable to create GSource



On Sun, 2003-12-21 at 21:06, Owen Taylor wrote:
On Sun, 2003-12-21 at 17:27, Ryan McDougall wrote:
Hello,
    I am developing a simple console based project using Glib (partly so I
can learn Glib) but I have lots of questions due to the less than
documented nature of Glib. Basically at this point all I want to do is
tie console input to the event loop -- but I have little idea how to go
about it.

Without looking at your code, I strongly suspect you want
g_io_channel_add_watch(), not a custom GSource.

Regards,
                                      Owen


Thank you for your time Owen,

        I have already discovered g_io_channel_watch through my meandering
about, but I was wanting to ask you some stuff.

Creating a custom GSource is the most explicit (and overkill for what I
want now) way of listening for input events, but I think I want to learn
how to do this for the sake of knowing how -- is there example code some
where? Is there a reason why I should derive my source from GSource?

Also, currently I use g_io_create_watch and manually attach the GSource
to the GMainContext, which makes sense to me, but how does
g_io_add_watch work if it doesnt take a reference to the GMainContext I
created? Id really like to know more about how this stuff works. :)

Cheers,
Ryan




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