[gnome-control-center] shell: Make CcNotebook buildable



commit f8da96e4259ac331c69587aec26f8c777ed4111b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 12 13:57:19 2012 -0400

    shell: Make CcNotebook buildable

 shell/cc-notebook.c |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/shell/cc-notebook.c b/shell/cc-notebook.c
index 77e23de..ac7ffd8 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;
+}



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