Re: [Basic Glib Questions/Help] Unable to create GSource
- From: Ryan McDougall <ryan mcdougall telusplanet net>
- To: Behdad Esfahbod <behdad cs toronto edu>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: [Basic Glib Questions/Help] Unable to create GSource
- Date: Sun, 21 Dec 2003 17:09:49 -0700
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]