Re: Gtk (HEAD) problem



Mikael Hermansson <mikeh bahnhof se> writes:
> I am trying to use the property API in glib to get values in GtkTextTag.
> 
> But I am getting GRuntime-CRITICAL **: file gvalue.c: line 48
> (g_value_init): assertion `G_VALUE_TYPE (value) == 0' failed when when
> calling: g_object_get_property using this code:
> 
>        GdkColor *col=NULL;
>         GValue val={0,};
>         g_value_init(&val,GTK_TYPE_GDK_COLOR); 
>         g_object_get_property(G_OBJECT(tag),"foreground_gdk",&val);	
>         col=g_value_get_as_pointer(&val);
>         if (col)
>           g_string_sprintfa(str,"<font
> color=#%X%X%X>\n",col->red,col->green,col->blue);
> 

Looks correct to me, which g_value_init() causes the warning? (what
line in libgobject?)

Havoc




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