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



On Sun, 2003-12-21 at 16:51, Behdad Esfahbod wrote:
You should replace this line:

        GSource*        clash_console_source    = g_source_new
(&clash_console_source_funcs, sizeof
(clash_console_source_funcs));

with the obvious fix:

        GSource*        clash_console_source    = g_source_new
(&clash_console_source_funcs, sizeof (GSource));

The docs state that:

struct_size :  size of the GSource structure to create

So it's not the size of source_funcs parameter (which is fix),
but is the size of _derived_ type you have created based on
GSource.  In your case, you don't have a derived type, so simply
use GSource itself and pass sizeof(GSource) as struct_size.

http://lidn.sourceforge.net/books/glib-2.0/book/glib-the-main-event-loop.html#G-SOURCE-NEW

behdad


Thanks! Its the little mistakes that get you! ;) Be prepared to hear
more from me as I learn more ...

Cheers,
Ryan




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