Re: Gtk (HEAD) problem



On lör, 10 feb 2001 18:50:08 Havoc Pennington wrote:
> 
> 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
> 

Sorry my late answer but it looks like the problem is happening in 
g_object_get_property when init the temp value (line 1214). Also
it could be the g_value_convert (wich also calls g_value_init)? 

gobject.c from line 1214:

gobject.c:1214:     g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE
(pspec));
gobject.c:1225:  g_value_convert (&tmp_value, value);

I will try recompile glib today with full debug to see were it goes wrong.

Greats

M.H




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