summaryrefslogtreecommitdiff
path: root/gtk/gtkcellview.c
diff options
context:
space:
mode:
authorHenrique Romano <henrique@async.com.br>2006-05-24 17:01:28 +0000
committerJohan Dahlin <johan@src.gnome.org>2006-05-24 17:01:28 +0000
commitaa12ca952263fb6b7a9500190a18309144adfc85 (patch)
treec2e0ba096c41e9ad92ca6cbaa6df87f331894230 /gtk/gtkcellview.c
parent7f6f61c9ff37178209b4c9a433b2421fc0180305 (diff)
downloadgdk-pixbuf-aa12ca952263fb6b7a9500190a18309144adfc85.tar.gz
Add model property for GtkCellView, part of #172535.
2006-05-24 Henrique Romano <henrique@async.com.br> * gtk/gtkcellview.c: (gtk_cell_view_class_init), (gtk_cell_view_get_property), (gtk_cell_view_set_property): Add model property for GtkCellView, part of #172535.
Diffstat (limited to 'gtk/gtkcellview.c')
-rw-r--r--gtk/gtkcellview.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index 1c8941576..527a8dfe7 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -114,7 +114,8 @@ enum
PROP_0,
PROP_BACKGROUND,
PROP_BACKGROUND_GDK,
- PROP_BACKGROUND_SET
+ PROP_BACKGROUND_SET,
+ PROP_MODEL
};
G_DEFINE_TYPE_WITH_CODE (GtkCellView, gtk_cell_view, GTK_TYPE_WIDGET,
@@ -152,6 +153,21 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE));
+ /**
+ * GtkCellView:model
+ *
+ * The model for cell view
+ *
+ * since 2.10
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_MODEL,
+ g_param_spec_object ("model",
+ P_("CellView model"),
+ P_("The model for cell view"),
+ GTK_TYPE_TREE_MODEL,
+ GTK_PARAM_READWRITE));
+
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (gobject_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
ADD_SET_PROP ("background-set", PROP_BACKGROUND_SET,
@@ -195,6 +211,9 @@ gtk_cell_view_get_property (GObject *object,
case PROP_BACKGROUND_SET:
g_value_set_boolean (value, view->priv->background_set);
break;
+ case PROP_MODEL:
+ g_value_set_object (value, view->priv->model);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
@@ -231,7 +250,10 @@ gtk_cell_view_set_property (GObject *object,
case PROP_BACKGROUND_SET:
view->priv->background_set = g_value_get_boolean (value);
break;
- default:
+ case PROP_MODEL:
+ gtk_cell_view_set_model (view, g_value_get_object (value));
+ break;
+ default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}