Variable gobject parameters
- From: Russell Shaw <rjshaw netspace net au>
- To: gtk-app-devel-list gnome org
- Subject: Variable gobject parameters
- Date: Sat, 29 May 2004 06:57:08 +1000
Hi all,
I'm trying to do:
GtkWidget *table=(GtkWidget*)g_object_new
(table_type,"datafile",datafile,
"text1","data1",
"text2","data2",
"text3","data3",
.
.
NULL);
The first parameter "datafile" is a normal property, followed
by its value, which i can do easy.
However, how do i set up gobject to read in the following "text*","data*"
pairs? Is there a GParamSpec suitable for this?
This variable number of pairs is to be stored in a single array in the widget
instance struct (as normal with any property).
I'm not sure how to write the set_property function either:
static void
table_set_property( GObject *object,
guint property_id,
const GValue *value,
GParamSpec *spec)
{
...
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]