[gnome-photos] spinner-box: Set the "contents" in constructed not init
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] spinner-box: Set the "contents" in constructed not init
- Date: Sat, 17 Nov 2012 13:27:41 +0000 (UTC)
commit a2ee14b50418122d94dc163a47617be02f6dccf6
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Nov 17 13:00:36 2012 +0100
spinner-box: Set the "contents" in constructed not init
Since "contents" is a construct property of GtkClutterActor, it can
only be set during g_object_new or in constructed. Setting it in init
will overwrite it.
src/photos-spinner-box.c | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
---
diff --git a/src/photos-spinner-box.c b/src/photos-spinner-box.c
index 44e9b38..74ad310 100644
--- a/src/photos-spinner-box.c
+++ b/src/photos-spinner-box.c
@@ -80,31 +80,16 @@ photos_spinner_box_move_out_completed (PhotosSpinnerBox *self)
static void
-photos_spinner_box_dispose (GObject *object)
+photos_spinner_box_constructed (GObject *object)
{
PhotosSpinnerBox *self = PHOTOS_SPINNER_BOX (object);
-
- photos_spinner_box_clear_delay_id (self);
-
- G_OBJECT_CLASS (photos_spinner_box_parent_class)->dispose (object);
-}
-
-
-static void
-photos_spinner_box_init (PhotosSpinnerBox *self)
-{
- PhotosSpinnerBoxPrivate *priv;
GtkWidget *bin;
GtkWidget *label;
GtkWidget *spinner;
GtkWidget *widget;
gchar *text;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, PHOTOS_TYPE_SPINNER_BOX, PhotosSpinnerBoxPrivate);
- priv = self->priv;
-
- clutter_actor_set_x_expand (CLUTTER_ACTOR (self), TRUE);
- clutter_actor_set_y_expand (CLUTTER_ACTOR (self), TRUE);
+ G_OBJECT_CLASS (photos_spinner_box_parent_class)->constructed (object);
widget = gtk_grid_new ();
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
@@ -140,10 +125,32 @@ photos_spinner_box_init (PhotosSpinnerBox *self)
static void
+photos_spinner_box_dispose (GObject *object)
+{
+ PhotosSpinnerBox *self = PHOTOS_SPINNER_BOX (object);
+
+ photos_spinner_box_clear_delay_id (self);
+
+ G_OBJECT_CLASS (photos_spinner_box_parent_class)->dispose (object);
+}
+
+
+static void
+photos_spinner_box_init (PhotosSpinnerBox *self)
+{
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, PHOTOS_TYPE_SPINNER_BOX, PhotosSpinnerBoxPrivate);
+
+ clutter_actor_set_x_expand (CLUTTER_ACTOR (self), TRUE);
+ clutter_actor_set_y_expand (CLUTTER_ACTOR (self), TRUE);
+}
+
+
+static void
photos_spinner_box_class_init (PhotosSpinnerBoxClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
+ object_class->constructed = photos_spinner_box_constructed;
object_class->dispose = photos_spinner_box_dispose;
g_type_class_add_private (class, sizeof (PhotosSpinnerBoxPrivate));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]