Re: how to use gtk_widget_get()



Quoth Thomas Mailund:
> On Sat, 2001-08-25 at 16:58, Joel Uckelman wrote:
> > When I run this bit of code:
> > 
> >    GtkArg arg;
> >    gint h1;
> >    
> >    arg.type = GTK_TYPE_UINT;
> >    arg.name = "row-height";    
> >    gtk_widget_get(clist, &arg);
> >    h1 = GTK_VALUE_UINT(arg)-4;
> > 
> > I get the following runtime warning:
> > 
> > Gtk-WARNING **: gtk_object_arg_get(): could not find argument "row-height" 
> > in the `GtkCList' class ancestry
> > 
> > But according to the documentation for GtkCList, "row-height" is listed as 
> > an arg. It seems to me that this should work for getting the row height, 
> > but apparently not--and I don't see any other way to get it. If anybody 
> > spots what's the problem here, I'd appreciate hearing about it.
> > 
> 
> >From reading the source (gtkclist.c)
> 
>   gtk_object_add_arg_type ("GtkCList::row_height",
> 			   GTK_TYPE_UINT,
> 			   GTK_ARG_READWRITE,
> 			   ARG_ROW_HEIGHT);
> 
> my guess is that you just need to use "row_height" rather than
> "row-height".  I haven't tried it 'cause I don't have any clist code
> lying around, but it should be easy for you to test.
> 
> 	/mailund

I changed the "-" to "_", and it worked, so I suppose that means the 
documentation is wrong, then?

Anyway, thanks for your help!

-- 
J.






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