To get the value of one or more arguments, you simply
create an array of
GtkArg, filling in the
name field of each
GtkArg.
gtk_object_getv() fills in the type fields and the argument values.
If an error occurs, the
type field is set to
GTK_TYPE_INVALID. If the fundamental type of the
returned value is
GTK_TYPE_STRING,
GTK_TYPE_BOXED, or
GTK_TYPE_ARGS, you are responsible for freeing it.
Here's a simple example:
GtkArg args[2];
args[0].name = "GtkContainer::border_width";
args[1].name = "GtkContainer::resize_mode";
gtk_object_getv(GTK_OBJECT(button),
2,
args);
g_assert(args[0].type == GTK_TYPE_ULONG);
g_assert(args[1].type == GTK_TYPE_RESIZE_MODE);
g_assert(GTK_FUNDAMENTAL_TYPE(args[1].type) == GTK_TYPE_ENUM);
printf("Border width: %lu Resize mode: %d\n",
GTK_VALUE_ULONG(args[0]), GTK_VALUE_ENUM(args[1]));
|