Re: g_value privates



Detlef Reichl <detlef reichl arcormail de> writes:

> to set a g_value afaik the right way is something like this:
> 
> GValue value;
> g_value_init (&value, G_TYPE_BOOLEAN);
> g_value_set_boolean (&value, FALSE);
> 
> but that gives me an
> 
> tree (pid:26012): GRuntime-WARNING **: gvalue.c:79:g_value_init():
> cannot initialize GValue with type `gboolean', the value has already
> been initialized as `(null)'
> 
> only if i set value.g_type = 0 before this it works like expected, but
> this is marked as privat

You are supposed to do:

 GValue value = { 0, };

Frankly, having to initialize a GValue _before_ g_value_init() is
bizarre and should not be required, but other people disagreed with
me.

Regards,
                                        Owen



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