[gimp/gtk3-port: 85/143] app: can't set the scale combo entry's properties in init() any longer



commit bd5d6ac3f44b6c91da2356c62e4a6bab03168f40
Author: Michael Natterer <mitch gimp org>
Date:   Tue Oct 19 20:24:43 2010 +0200

    app: can't set the scale combo entry's properties in init() any longer
    
    Set them in constructed() instead.

 app/display/gimpscalecombobox.c |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/app/display/gimpscalecombobox.c b/app/display/gimpscalecombobox.c
index ea74ec5..0261e28 100644
--- a/app/display/gimpscalecombobox.c
+++ b/app/display/gimpscalecombobox.c
@@ -52,6 +52,7 @@ enum
 };
 
 
+static void      gimp_scale_combo_box_constructed     (GObject           *object);
 static void      gimp_scale_combo_box_finalize        (GObject           *object);
 
 static void      gimp_scale_combo_box_style_set       (GtkWidget         *widget,
@@ -93,11 +94,12 @@ gimp_scale_combo_box_class_init (GimpScaleComboBoxClass *klass)
                   gimp_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
 
-  object_class->finalize  = gimp_scale_combo_box_finalize;
+  object_class->constructed = gimp_scale_combo_box_constructed;
+  object_class->finalize    = gimp_scale_combo_box_finalize;
 
-  widget_class->style_set = gimp_scale_combo_box_style_set;
+  widget_class->style_set   = gimp_scale_combo_box_style_set;
 
-  klass->entry_activated  = NULL;
+  klass->entry_activated    = NULL;
 
   gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_double ("label-scale",
@@ -111,13 +113,19 @@ gimp_scale_combo_box_class_init (GimpScaleComboBoxClass *klass)
 static void
 gimp_scale_combo_box_init (GimpScaleComboBox *combo_box)
 {
-  GtkWidget       *entry;
-  GtkListStore    *store;
-  GtkCellLayout   *layout;
-  GtkCellRenderer *cell;
-  GtkTreeIter      iter;
-  GtkBorder        border = { 0, 0, 0, 0 };
-  gint             i;
+}
+
+static void
+gimp_scale_combo_box_constructed (GObject *object)
+{
+  GimpScaleComboBox *combo_box = GIMP_SCALE_COMBO_BOX (object);
+  GtkWidget         *entry;
+  GtkListStore      *store;
+  GtkCellLayout     *layout;
+  GtkCellRenderer   *cell;
+  GtkTreeIter        iter;
+  GtkBorder          border = { 0, 0, 0, 0 };
+  gint               i;
 
   combo_box->scale     = 1.0;
   combo_box->last_path = NULL;
@@ -135,7 +143,6 @@ gimp_scale_combo_box_init (GimpScaleComboBox *combo_box)
   entry = gtk_bin_get_child (GTK_BIN (combo_box));
 
   g_object_set (entry,
-                "has-entry",          TRUE,
                 "xalign",             1.0,
                 "width-chars",        7,
                 "truncate-multiline", TRUE,
@@ -453,7 +460,9 @@ gimp_scale_combo_box_mru_remove_last (GimpScaleComboBox *combo_box)
 GtkWidget *
 gimp_scale_combo_box_new (void)
 {
-  return g_object_new (GIMP_TYPE_SCALE_COMBO_BOX, NULL);
+  return g_object_new (GIMP_TYPE_SCALE_COMBO_BOX,
+                       "has-entry", TRUE,
+                       NULL);
 }
 
 void



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