[gimp] app: remove deprecated gtk_range_set_update_policy



commit ef15fd8623e292f9c1a3440c2e6d661b3b65c3cf
Author: massimo v <massimo mars central>
Date:   Tue May 24 18:50:16 2011 +0200

    app: remove deprecated gtk_range_set_update_policy

 app/tools/gimpforegroundselectoptions.c |   20 ++++++--------------
 app/tools/gimpforegroundselecttool.c    |   11 +++++++----
 2 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/app/tools/gimpforegroundselectoptions.c b/app/tools/gimpforegroundselectoptions.c
index 68063f0..0396bf2 100644
--- a/app/tools/gimpforegroundselectoptions.c
+++ b/app/tools/gimpforegroundselectoptions.c
@@ -268,7 +268,6 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
   GtkWidget *menu;
   GtkWidget *inner_frame;
   GtkWidget *table;
-  GtkObject *adj;
   gchar     *title;
   gint       row = 0;
 
@@ -331,7 +330,6 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
   gtk_widget_show (table);
 
   scale = gimp_prop_hscale_new (config, "smoothness", 0.1, 1.0, 0);
-  gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
   gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_RIGHT);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("Smoothing:"), 0.0, 0.5, scale, 2, FALSE);
@@ -357,20 +355,14 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
   gtk_container_add (GTK_CONTAINER (inner_frame), table);
   gtk_widget_show (table);
 
-  adj = gimp_prop_opacity_entry_new (config, "sensitivity-l",
-                                     GTK_TABLE (table), 0, row++, "L");
-  gtk_range_set_update_policy (GTK_RANGE (GIMP_SCALE_ENTRY_SCALE (adj)),
-                               GTK_UPDATE_DELAYED);
+  gimp_prop_opacity_entry_new (config, "sensitivity-l",
+                               GTK_TABLE (table), 0, row++, "L");
 
-  adj = gimp_prop_opacity_entry_new (config, "sensitivity-a",
-                                     GTK_TABLE (table), 0, row++, "a");
-  gtk_range_set_update_policy (GTK_RANGE (GIMP_SCALE_ENTRY_SCALE (adj)),
-                               GTK_UPDATE_DELAYED);
+  gimp_prop_opacity_entry_new (config, "sensitivity-a",
+                               GTK_TABLE (table), 0, row++, "a");
 
-  adj = gimp_prop_opacity_entry_new (config, "sensitivity-b",
-                                     GTK_TABLE (table), 0, row++, "b");
-  gtk_range_set_update_policy (GTK_RANGE (GIMP_SCALE_ENTRY_SCALE (adj)),
-                               GTK_UPDATE_DELAYED);
+  gimp_prop_opacity_entry_new (config, "sensitivity-b",
+                               GTK_TABLE (table), 0, row++, "b");
 
   return vbox;
 }
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index a4bb962..95c9ae2 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -832,6 +832,9 @@ gimp_foreground_select_tool_idle_select (GimpForegroundSelectTool *fg_select)
   return FALSE;
 }
 
+/* To compress close notify signals, the process is delayed by */
+#define MINIMUM_DELAY 300
+
 static void
 gimp_foreground_select_options_notify (GimpForegroundSelectOptions *options,
                                        GParamSpec                  *pspec,
@@ -862,10 +865,10 @@ gimp_foreground_select_options_notify (GimpForegroundSelectOptions *options,
       if (fg_select->idle_id)
         g_source_remove (fg_select->idle_id);
 
-      fg_select->idle_id =
-        g_idle_add_full (G_PRIORITY_LOW,
-                         (GSourceFunc) gimp_foreground_select_tool_idle_select,
-                         fg_select, NULL);
+      fg_select->idle_id = 
+        g_timeout_add_full (G_PRIORITY_LOW, MINIMUM_DELAY,
+                            (GSourceFunc) gimp_foreground_select_tool_idle_select,
+                            fg_select, NULL);
     }
 
   if (g_str_has_prefix (pspec->name, "mask-color"))



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