[gimp] plug-ins: replace some gimp_spin_button_new() by plain GTK+ calls



commit 79cdbadc95a3914bc89cb3f4fe812305e68083c2
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 18 09:49:22 2016 +0200

    plug-ins: replace some gimp_spin_button_new() by plain GTK+ calls

 plug-ins/common/curve-bend.c     |   37 ++++++++++++++++-----------------
 plug-ins/common/film.c           |   42 +++++++++++++++++++++----------------
 plug-ins/common/smooth-palette.c |   23 +++++++++++---------
 3 files changed, 55 insertions(+), 47 deletions(-)
---
diff --git a/plug-ins/common/curve-bend.c b/plug-ins/common/curve-bend.c
index e7a5f96..005e5a6 100644
--- a/plug-ins/common/curve-bend.c
+++ b/plug-ins/common/curve-bend.c
@@ -1163,21 +1163,20 @@ static BenderDialog *
 bender_new_dialog (GimpDrawable *drawable)
 {
   BenderDialog *cd;
-  GtkWidget  *main_hbox;
-  GtkWidget  *vbox;
-  GtkWidget  *hbox;
-  GtkWidget  *vbox2;
-  GtkWidget  *abox;
-  GtkWidget  *frame;
-  GtkWidget  *upper, *lower;
-  GtkWidget  *smooth, *freew;
-  GtkWidget  *toggle;
-  GtkWidget  *button;
-  GtkWidget  *spinbutton;
-  GtkWidget  *label;
-  GtkObject  *data;
-  GdkDisplay *display;
-  gint        i, j;
+  GtkWidget    *main_hbox;
+  GtkWidget    *vbox;
+  GtkWidget    *hbox;
+  GtkWidget    *vbox2;
+  GtkWidget    *abox;
+  GtkWidget    *frame;
+  GtkWidget    *upper, *lower;
+  GtkWidget    *smooth, *freew;
+  GtkWidget    *toggle;
+  GtkWidget    *button;
+  GtkWidget    *spinbutton;
+  GtkWidget    *label;
+  GdkDisplay   *display;
+  gint          i, j;
 
   cd = g_new (BenderDialog, 1);
 
@@ -1324,11 +1323,11 @@ bender_new_dialog (GimpDrawable *drawable)
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
 
-  spinbutton = gimp_spin_button_new (&data,
-                                     0, 0.0, 360.0, 1, 45, 90,
-                                     0.5, 1);
-  cd->rotate_data = GTK_ADJUSTMENT (data);
+  cd->rotate_data = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0.0, 360.0, 1, 45, 0));
   gtk_adjustment_set_value (cd->rotate_data, cd->rotation);
+
+  spinbutton = gtk_spin_button_new (cd->rotate_data, 0.5, 1);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
   gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
   gtk_widget_show (spinbutton);
 
diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c
index e1ec793..d79d6bc 100644
--- a/plug-ins/common/film.c
+++ b/plug-ins/common/film.c
@@ -944,20 +944,20 @@ static void
 create_selection_tab (GtkWidget *notebook,
                       gint32     image_ID)
 {
-  GtkSizeGroup *group;
-  GtkWidget    *vbox;
-  GtkWidget    *vbox2;
-  GtkWidget    *hbox;
-  GtkWidget    *table;
-  GtkWidget    *label;
-  GtkWidget    *frame;
-  GtkWidget    *toggle;
-  GtkWidget    *spinbutton;
-  GtkObject    *adj;
-  GtkWidget    *button;
-  GtkWidget    *font_button;
-  gint32       *image_id_list;
-  gint          nimages, j;
+  GtkSizeGroup  *group;
+  GtkWidget     *vbox;
+  GtkWidget     *vbox2;
+  GtkWidget     *hbox;
+  GtkWidget     *table;
+  GtkWidget     *label;
+  GtkWidget     *frame;
+  GtkWidget     *toggle;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
+  GtkWidget     *button;
+  GtkWidget     *font_button;
+  gint32        *image_id_list;
+  gint           nimages, j;
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
@@ -996,8 +996,11 @@ create_selection_tab (GtkWidget *notebook,
   gtk_widget_show (table);
 
   /* Film height */
-  spinbutton = gimp_spin_button_new (&adj, filmvals.film_height, 10,
-                                     GIMP_MAX_IMAGE_SIZE, 1, 10, 0, 1, 0);
+  adj = GTK_ADJUSTMENT (gtk_adjustment_new (filmvals.film_height, 10,
+                                            GIMP_MAX_IMAGE_SIZE, 1, 10, 0));
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
+
   label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                                      _("_Height:"), 0.0, 0.5,
                                      spinbutton, 1, TRUE);
@@ -1049,8 +1052,11 @@ create_selection_tab (GtkWidget *notebook,
   gtk_widget_show (table);
 
   /* Startindex */
-  spinbutton = gimp_spin_button_new (&adj, filmvals.number_start, 0,
-                                     GIMP_MAX_IMAGE_SIZE, 1, 10, 0, 1, 0);
+  adj = GTK_ADJUSTMENT (gtk_adjustment_new (filmvals.number_start, 0,
+                                            GIMP_MAX_IMAGE_SIZE, 1, 10, 0));
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
+
   label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                                      _("Start _index:"), 0.0, 0.5,
                                      spinbutton, 1, TRUE);
diff --git a/plug-ins/common/smooth-palette.c b/plug-ins/common/smooth-palette.c
index e3f6837..a4edaef 100644
--- a/plug-ins/common/smooth-palette.c
+++ b/plug-ins/common/smooth-palette.c
@@ -398,14 +398,14 @@ smooth_palette (GimpDrawable *drawable,
 static gboolean
 dialog (GimpDrawable *drawable)
 {
-  GtkWidget *dlg;
-  GtkWidget *spinbutton;
-  GtkObject *adj;
-  GtkWidget *sizeentry;
-  guint32    image_id;
-  GimpUnit   unit;
-  gdouble    xres, yres;
-  gboolean   run;
+  GtkWidget     *dlg;
+  GtkWidget     *spinbutton;
+  GtkAdjustment *adj;
+  GtkWidget     *sizeentry;
+  guint32        image_id;
+  GimpUnit       unit;
+  gdouble        xres, yres;
+  gboolean       run;
 
   gimp_ui_init (PLUG_IN_BINARY, FALSE);
 
@@ -447,8 +447,11 @@ dialog (GimpDrawable *drawable)
                       sizeentry, FALSE, FALSE, 0);
   gtk_widget_show (sizeentry);
 
-  spinbutton = gimp_spin_button_new (&adj, config.ntries,
-                                     1, 1024, 1, 10, 0, 1, 0);
+  adj = GTK_ADJUSTMENT (gtk_adjustment_new (config.ntries,
+                                            1, 1024, 1, 10, 0));
+  spinbutton = gtk_spin_button_new (adj, 1, 0);
+  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
+
   gimp_table_attach_aligned (GTK_TABLE (sizeentry), 0, 2,
                              _("_Search depth:"), 0.0, 0.5,
                              spinbutton, 1, FALSE);


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