[gimp] plug-ins: add some GTK_CHECK_VERSION(2, 24, 0) and use the new GtkComboBoxText



commit bdf8d3d776907b2f862335f77b9c3153b2a3176e
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 17 14:31:39 2011 +0100

    plug-ins: add some GTK_CHECK_VERSION(2,24,0) and use the new GtkComboBoxText

 plug-ins/common/animation-play.c         |   16 ++++++++++++++++
 plug-ins/common/file-gih.c               |    9 +++++++++
 plug-ins/common/file-ps.c                |   10 ++++++++++
 plug-ins/script-fu/script-fu-interface.c |   11 ++++++++++-
 4 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/animation-play.c b/plug-ins/common/animation-play.c
index 5854738..bd6a195 100644
--- a/plug-ins/common/animation-play.c
+++ b/plug-ins/common/animation-play.c
@@ -649,7 +649,11 @@ build_dialog (GimpImageBaseType  basetype,
   gtk_box_pack_end (GTK_BOX (hbox), progress, TRUE, TRUE, 0);
   gtk_widget_show (progress);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+  speedcombo = gtk_combo_box_text_new ();
+#else
   speedcombo = gtk_combo_box_new_text ();
+#endif
   gtk_box_pack_end (GTK_BOX (hbox), speedcombo, FALSE, FALSE, 0);
   gtk_widget_show (speedcombo);
 
@@ -659,7 +663,11 @@ build_dialog (GimpImageBaseType  basetype,
 
       /* list is given in "fps" - frames per second */
       text = g_strdup_printf  (_("%d fps"), get_fps (index));
+#if GTK_CHECK_VERSION (2, 24, 0)
+      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speedcombo), text);
+#else
       gtk_combo_box_append_text (GTK_COMBO_BOX (speedcombo), text);
+#endif
       g_free (text);
     }
 
@@ -671,7 +679,11 @@ build_dialog (GimpImageBaseType  basetype,
 
   gimp_help_set_help_data (speedcombo, _("Default framerate"), NULL);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+  speedcombo = gtk_combo_box_text_new ();
+#else
   speedcombo = gtk_combo_box_new_text ();
+#endif
   gtk_box_pack_end (GTK_BOX (hbox), speedcombo, FALSE, FALSE, 0);
   gtk_widget_show (speedcombo);
 
@@ -680,7 +692,11 @@ build_dialog (GimpImageBaseType  basetype,
       gchar *text;
 
       text = g_strdup_printf  ("%g\303\227", (100 / get_duration_factor (index)) / 100);
+#if GTK_CHECK_VERSION (2, 24, 0)
+      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speedcombo), text);
+#else
       gtk_combo_box_append_text (GTK_COMBO_BOX (speedcombo), text);
+#endif
       g_free (text);
     }
 
diff --git a/plug-ins/common/file-gih.c b/plug-ins/common/file-gih.c
index 92ed172..2fd015d 100644
--- a/plug-ins/common/file-gih.c
+++ b/plug-ins/common/file-gih.c
@@ -1060,10 +1060,19 @@ gih_save_dialog (gint32 image_ID)
             cellw_adjust.rank0 = cellh_adjust.rank0 = NULL;
         }
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+      cb = gtk_combo_box_text_new ();
+#else
       cb = gtk_combo_box_new_text ();
+#endif
 
       for (j = 0; j < G_N_ELEMENTS (selection_modes); j++)
+#if GTK_CHECK_VERSION (2, 24, 0)
+        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb),
+                                        selection_modes[j]);
+#else
         gtk_combo_box_append_text (GTK_COMBO_BOX (cb), selection_modes[j]);
+#endif
 
       gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 2);  /* random */
 
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index 4209d13..479c642 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -3196,11 +3196,21 @@ load_dialog (const gchar *filename,
       gimp_help_set_help_data (GTK_WIDGET (entry),
                                _("Pages to load (e.g.: 1-4 or 1,3,5-7)"), NULL);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+      target = gtk_combo_box_text_new ();
+      gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (target),
+                                      GIMP_PAGE_SELECTOR_TARGET_LAYERS,
+                                      _("Layers"));
+      gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (target),
+                                      GIMP_PAGE_SELECTOR_TARGET_IMAGES,
+                                      _("Images"));
+#else
       target = gtk_combo_box_new_text ();
       gtk_combo_box_insert_text (GTK_COMBO_BOX (target),
                                  GIMP_PAGE_SELECTOR_TARGET_LAYERS, _("Layers"));
       gtk_combo_box_insert_text (GTK_COMBO_BOX (target),
                                  GIMP_PAGE_SELECTOR_TARGET_IMAGES, _("Images"));
+#endif
       gtk_combo_box_set_active (GTK_COMBO_BOX (target), (int) ps_pagemode);
       gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
                                  _("Open as"), 0.0, 0.5,
diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c
index 724384f..0d49142 100644
--- a/plug-ins/script-fu/script-fu-interface.c
+++ b/plug-ins/script-fu/script-fu-interface.c
@@ -503,13 +503,22 @@ script_fu_interface (SFScript  *script,
           break;
 
         case SF_OPTION:
+#if GTK_CHECK_VERSION (2, 24, 0)
+          widget = gtk_combo_box_text_new ();
+#else
           widget = gtk_combo_box_new_text ();
+#endif
           for (list = arg->default_value.sfa_option.list;
                list;
                list = g_slist_next (list))
             {
+#if GTK_CHECK_VERSION (2, 24, 0)
+              gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget),
+                                              gettext (list->data));
+#else
               gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
-                                         gettext ((const gchar *) list->data));
+                                         gettext (list->data));
+#endif
             }
 
           gtk_combo_box_set_active (GTK_COMBO_BOX (widget),



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