[gimp/gtk3-port: 54/243] app: port GimpScalComboBox to GTK+ 3.0



commit 6f12d869478cb94393b4acb4a5a4da29c7f5cfec
Author: Michael Natterer <mitch gimp org>
Date:   Tue Oct 19 12:21:11 2010 +0200

    app: port GimpScalComboBox to GTK+ 3.0

 app/display/gimpscalecombobox.c |    6 +++---
 app/display/gimpscalecombobox.h |   26 ++++++++------------------
 2 files changed, 11 insertions(+), 21 deletions(-)
---
diff --git a/app/display/gimpscalecombobox.c b/app/display/gimpscalecombobox.c
index 20db1c0..663674d 100644
--- a/app/display/gimpscalecombobox.c
+++ b/app/display/gimpscalecombobox.c
@@ -71,7 +71,7 @@ static void      gimp_scale_combo_box_scale_iter_set  (GtkListStore      *store,
 
 
 G_DEFINE_TYPE (GimpScaleComboBox, gimp_scale_combo_box,
-               GTK_TYPE_COMBO_BOX_ENTRY)
+               GTK_TYPE_COMBO_BOX)
 
 #define parent_class gimp_scale_combo_box_parent_class
 
@@ -130,12 +130,12 @@ gimp_scale_combo_box_init (GimpScaleComboBox *combo_box)
   gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (store));
   g_object_unref (store);
 
-  gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo_box),
-                                       COLUMN_LABEL);
+  gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (combo_box), COLUMN_LABEL);
 
   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,
diff --git a/app/display/gimpscalecombobox.h b/app/display/gimpscalecombobox.h
index 9ab2db7..a4500d9 100644
--- a/app/display/gimpscalecombobox.h
+++ b/app/display/gimpscalecombobox.h
@@ -22,16 +22,6 @@
 #define __GIMP_SCALE_COMBO_BOX_H__
 
 
-#if GTK_CHECK_VERSION(2,23,1)
-#undef GTK_DISABLE_DEPRECATED
-#undef GTK_DISABLE_SINGLE_INCLUDES
-#undef __GTK_COMBO_BOX_ENTRY_H__
-#include <gtk/gtkcomboboxentry.h>
-#define GTK_DISABLE_SINGLE_INCLUDES
-#define GTK_DISABLE_DEPRECATED
-#endif
-
-
 #define GIMP_TYPE_SCALE_COMBO_BOX            (gimp_scale_combo_box_get_type ())
 #define GIMP_SCALE_COMBO_BOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SCALE_COMBO_BOX, GimpScaleComboBox))
 #define GIMP_SCALE_COMBO_BOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SCALE_COMBO_BOX, GimpScaleComboBoxClass))
@@ -42,20 +32,20 @@
 
 typedef struct _GimpScaleComboBoxClass  GimpScaleComboBoxClass;
 
-struct _GimpScaleComboBoxClass
+struct _GimpScaleComboBox
 {
-  GtkComboBoxEntryClass  parent_instance;
+  GtkComboBox  parent_instance;
 
-  void (* entry_activated) (GimpScaleComboBox *combo_box);
+  gdouble      scale;
+  GtkTreePath *last_path;
+  GList       *mru;
 };
 
-struct _GimpScaleComboBox
+struct _GimpScaleComboBoxClass
 {
-  GtkComboBoxEntry  parent_instance;
+  GtkComboBoxClass  parent_instance;
 
-  gdouble           scale;
-  GtkTreePath      *last_path;
-  GList            *mru;
+  void (* entry_activated) (GimpScaleComboBox *combo_box);
 };
 
 



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