From f8da96e4259ac331c69587aec26f8c777ed4111b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 12 Jun 2012 13:57:19 -0400 Subject: [PATCH] shell: Make CcNotebook buildable --- shell/cc-notebook.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/shell/cc-notebook.c b/shell/cc-notebook.c index 77e23de71..ac7ffd821 100644 --- a/shell/cc-notebook.c +++ b/shell/cc-notebook.c @@ -68,7 +68,18 @@ enum static GParamSpec *obj_props[LAST_PROP] = { NULL, }; -G_DEFINE_TYPE (CcNotebook, cc_notebook, GTK_TYPE_BOX) +static void +cc_notebook_buildable_add_child (GtkBuildable *buildable, + GtkBuilder *builder, + GObject *child, + const gchar *type); + +static void +cc_notebook_buildable_init (GtkBuildableIface *iface); + +G_DEFINE_TYPE_WITH_CODE (CcNotebook, cc_notebook, GTK_TYPE_BOX, + G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, + cc_notebook_buildable_init)) static void cc_notebook_get_property (GObject *gobject, @@ -536,3 +547,19 @@ cc_notebook_get_selected_page (CcNotebook *self) return self->priv->selected_page; } + +static void +cc_notebook_buildable_add_child (GtkBuildable *buildable, + GtkBuilder *builder, + GObject *child, + const gchar *type) +{ + CcNotebook *notebook = CC_NOTEBOOK (buildable); + cc_notebook_add_page (notebook, GTK_WIDGET (child)); +} + +static void +cc_notebook_buildable_init (GtkBuildableIface *iface) +{ + iface->add_child = cc_notebook_buildable_add_child; +}