[gimp] plug-ins: use g_object_bind_property() to set widgets sensitive



commit 77b615e899ee76278278fcfd4ab99f61b1a3abd1
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 11 11:41:26 2011 +0200

    plug-ins: use g_object_bind_property() to set widgets sensitive
    
    depending on toggle buttons instead of libgimpwidgets' "set_sensitive"
    hack.

 plug-ins/common/displace.c               |   32 ++++++++++++++++-------------
 plug-ins/common/file-gif-save.c          |    9 +++----
 plug-ins/common/file-html-table.c        |    5 ++-
 plug-ins/common/file-ps.c                |    5 ++-
 plug-ins/common/file-svg.c               |   14 ++++--------
 plug-ins/common/file-xbm.c               |   10 +++++---
 plug-ins/common/film.c                   |   13 +++++++----
 plug-ins/common/iwarp.c                  |   10 +++++---
 plug-ins/common/oilify.c                 |   10 +++++---
 plug-ins/common/ripple.c                 |    5 ++-
 plug-ins/common/screenshot.c             |   13 +++++++----
 plug-ins/common/tile-paper.c             |    8 +++---
 plug-ins/common/tile-small.c             |   25 ++++++++++++++---------
 plug-ins/gradient-flare/gradient-flare.c |   11 ++++++---
 plug-ins/lighting/lighting-ui.c          |   10 +++++---
 plug-ins/map-object/map-object-ui.c      |    5 ++-
 16 files changed, 105 insertions(+), 80 deletions(-)
---
diff --git a/plug-ins/common/displace.c b/plug-ins/common/displace.c
index f4ad051..e4d9f3e 100644
--- a/plug-ins/common/displace.c
+++ b/plug-ins/common/displace.c
@@ -379,6 +379,7 @@ displace_dialog (GimpDrawable *drawable)
                                      1, 10, 0, 1, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 1, 2, 0, 1,
                     GTK_FILL, GTK_FILL, 0, 0);
+  gtk_widget_show (spinbutton);
 
   g_signal_connect (adj, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),
@@ -387,24 +388,25 @@ displace_dialog (GimpDrawable *drawable)
                             G_CALLBACK (gimp_preview_invalidate),
                             preview);
 
-  gtk_widget_set_sensitive (spinbutton, dvals.do_x);
-  g_object_set_data (G_OBJECT (toggle_x), "set_sensitive", spinbutton);
-  gtk_widget_show (spinbutton);
+  g_object_bind_property (toggle_x,   "active",
+                          spinbutton, "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   combo = gimp_drawable_combo_box_new (displace_map_constrain, drawable);
   gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.displace_map_x,
                               G_CALLBACK (gimp_int_combo_box_get_active),
                               &dvals.displace_map_x);
-  g_signal_connect_swapped (combo, "changed",
-                            G_CALLBACK (gimp_preview_invalidate),
-                            preview);
-
   gtk_table_attach (GTK_TABLE (table), combo, 2, 3, 0, 1,
                     GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
   gtk_widget_show (combo);
 
-  gtk_widget_set_sensitive (combo, dvals.do_x);
-  g_object_set_data (G_OBJECT (spinbutton), "set_sensitive", combo);
+  g_signal_connect_swapped (combo, "changed",
+                            G_CALLBACK (gimp_preview_invalidate),
+                            preview);
+
+  g_object_bind_property (toggle_x, "active",
+                          combo,    "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   /*  Y Options  */
   toggle_y = gtk_check_button_new_with_mnemonic (_("_Y displacement:"));
@@ -426,6 +428,7 @@ displace_dialog (GimpDrawable *drawable)
                                      1, 10, 0, 1, 2);
   gtk_table_attach (GTK_TABLE (table), spinbutton, 1, 2, 1, 2,
                     GTK_FILL, GTK_FILL, 0, 0);
+  gtk_widget_show (spinbutton);
 
   g_signal_connect (adj, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),
@@ -434,9 +437,9 @@ displace_dialog (GimpDrawable *drawable)
                             G_CALLBACK (gimp_preview_invalidate),
                             preview);
 
-  gtk_widget_set_sensitive (spinbutton, dvals.do_y);
-  g_object_set_data (G_OBJECT (toggle_y), "set_sensitive", spinbutton);
-  gtk_widget_show (spinbutton);
+  g_object_bind_property (toggle_y,   "active",
+                          spinbutton, "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   combo = gimp_drawable_combo_box_new (displace_map_constrain, drawable);
   gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), dvals.displace_map_y,
@@ -450,8 +453,9 @@ displace_dialog (GimpDrawable *drawable)
                     GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
   gtk_widget_show (combo);
 
-  gtk_widget_set_sensitive (combo, dvals.do_y);
-  g_object_set_data (G_OBJECT (spinbutton), "set_sensitive", combo);
+  g_object_bind_property (toggle_y, "active",
+                          combo,    "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   hbox = gtk_hbox_new (FALSE, 24);
   gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
diff --git a/plug-ins/common/file-gif-save.c b/plug-ins/common/file-gif-save.c
index 6f2dc20..0c3feb1 100644
--- a/plug-ins/common/file-gif-save.c
+++ b/plug-ins/common/file-gif-save.c
@@ -1210,11 +1210,10 @@ save_dialog (gint32 image_ID)
                                "you are trying to export only has one "
                                "layer."),
                              NULL);
-  gtk_widget_set_sensitive (frame, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)));
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", frame);
-  g_signal_connect (toggle, "toggled",
-                    G_CALLBACK (gimp_toggle_button_sensitive_update),
-                    NULL);
+
+  g_object_bind_property (toggle, "active",
+                          frame,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   gtk_widget_show (dialog);
 
diff --git a/plug-ins/common/file-html-table.c b/plug-ins/common/file-html-table.c
index fcd999c..ebec6d4 100644
--- a/plug-ins/common/file-html-table.c
+++ b/plug-ins/common/file-html-table.c
@@ -533,8 +533,9 @@ save_dialog (gint32 image_ID)
                     G_CALLBACK (gtm_caption_callback),
                     NULL);
 
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", entry);
-  gtk_widget_set_sensitive (entry, gtmvals.caption);
+  g_object_bind_property (toggle, "active",
+                          entry,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   entry = gtk_entry_new ();
   gtk_widget_set_size_request (entry, 200, -1);
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index ab7e109..857023b 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -3488,8 +3488,9 @@ save_dialog (void)
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", table);
-  gtk_widget_set_sensitive (table, psvals.preview);
+  g_object_bind_property (toggle, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   spinbutton = gimp_spin_button_new (&adj, psvals.preview_size,
                                      0, 1024, 1, 10, 0, 1, 0);
diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c
index 5c2cc9f..3af5b06 100644
--- a/plug-ins/common/file-svg.c
+++ b/plug-ins/common/file-svg.c
@@ -953,6 +953,7 @@ load_dialog (const gchar  *filename,
 
   /*  Path Import  */
   toggle = gtk_check_button_new_with_mnemonic (_("Import _paths"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), load_vals.import);
   gtk_table_attach (GTK_TABLE (table), toggle, 0, 2, 5, 6,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
   gtk_widget_show (toggle);
@@ -962,28 +963,23 @@ load_dialog (const gchar  *filename,
                              "can be used with the GIMP path tool"),
                            NULL);
 
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), load_vals.import);
   g_signal_connect (toggle, "toggled",
                     G_CALLBACK (gimp_toggle_button_update),
                     &load_vals.import);
 
-  g_signal_connect (toggle, "toggled",
-                    G_CALLBACK (gimp_toggle_button_sensitive_update),
-                    NULL);
-
   toggle2 = gtk_check_button_new_with_mnemonic (_("Merge imported paths"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle2), load_vals.merge);
   gtk_table_attach (GTK_TABLE (table), toggle2, 0, 2, 6, 7,
                     GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
-  gtk_widget_set_sensitive (toggle2, load_vals.import);
   gtk_widget_show (toggle2);
 
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle2), load_vals.merge);
   g_signal_connect (toggle2, "toggled",
                     G_CALLBACK (gimp_toggle_button_update),
                     &load_vals.merge);
 
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", toggle2);
-
+  g_object_bind_property (toggle,  "active",
+                          toggle2, "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   gtk_widget_show (dialog);
 
diff --git a/plug-ins/common/file-xbm.c b/plug-ins/common/file-xbm.c
index ef73778..6cd39e4 100644
--- a/plug-ins/common/file-xbm.c
+++ b/plug-ins/common/file-xbm.c
@@ -1255,8 +1255,9 @@ save_dialog (gint32 drawable_ID)
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", table);
-  gtk_widget_set_sensitive (table, xsvals.use_hot);
+  g_object_bind_property (toggle, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   spinbutton = gimp_spin_button_new (&adj, xsvals.x_hot, 0,
                                      gimp_drawable_width (drawable_ID) - 1,
@@ -1308,8 +1309,9 @@ save_dialog (gint32 drawable_ID)
                     G_CALLBACK (mask_ext_entry_callback),
                     NULL);
 
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", entry);
-  gtk_widget_set_sensitive (entry, xsvals.write_mask);
+  g_object_bind_property (toggle, "active",
+                          entry,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   gtk_widget_set_sensitive (frame, gimp_drawable_has_alpha (drawable_ID));
 
diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c
index af18cd9..1c0d344 100644
--- a/plug-ins/common/film.c
+++ b/plug-ins/common/film.c
@@ -1010,11 +1010,14 @@ create_selection_tab (GtkWidget *notebook,
                     G_CALLBACK (gimp_int_adjustment_update),
                     &filmvals.film_height);
 
-  g_object_set_data (G_OBJECT (toggle), "inverse_sensitive", spinbutton);
-  g_object_set_data
-    (G_OBJECT (spinbutton), "inverse_sensitive",
-     /* FIXME: eeeeeek */
-     g_list_nth_data (gtk_container_get_children (GTK_CONTAINER (table)), 1));
+  g_object_bind_property (toggle,     "active",
+                          spinbutton, "sensitive",
+                          G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+  g_object_bind_property (toggle,     "active",
+                          /* FIXME: eeeeeek */
+                          g_list_nth_data (gtk_container_get_children (GTK_CONTAINER (table)), 1), "sensitive",
+                          G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
                                 filmvals.keep_height);
 
diff --git a/plug-ins/common/iwarp.c b/plug-ins/common/iwarp.c
index e8a4657..69f79ef 100644
--- a/plug-ins/common/iwarp.c
+++ b/plug-ins/common/iwarp.c
@@ -1044,8 +1044,9 @@ iwarp_animate_dialog (GtkWidget *dialog,
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  g_object_set_data (G_OBJECT (button), "set_sensitive", table);
-  gtk_widget_set_sensitive (table, do_animate);
+  g_object_bind_property (button, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                                      _("Number of _frames:"), SCALE_WIDTH, 0,
@@ -1196,8 +1197,9 @@ iwarp_settings_dialog (GtkWidget *dialog,
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  g_object_set_data (G_OBJECT (button), "set_sensitive", table);
-  gtk_widget_set_sensitive (table, iwarp_vals.do_supersample);
+  g_object_bind_property (button, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                                      _("Ma_x depth:"), SCALE_WIDTH, 5,
diff --git a/plug-ins/common/oilify.c b/plug-ins/common/oilify.c
index 846d2a5..b38b48f 100644
--- a/plug-ins/common/oilify.c
+++ b/plug-ins/common/oilify.c
@@ -858,8 +858,9 @@ oilify_dialog (GimpDrawable *drawable)
                     GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
   gtk_widget_show (combo);
 
-  gtk_widget_set_sensitive (combo, ovals.use_mask_size_map);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", combo);
+  g_object_bind_property (toggle, "active",
+                          combo,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   /*
    * Exponent scale
@@ -910,8 +911,9 @@ oilify_dialog (GimpDrawable *drawable)
                     GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
   gtk_widget_show (combo);
 
-  gtk_widget_set_sensitive (combo, ovals.use_exponent_map);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", combo);
+  g_object_bind_property (toggle, "active",
+                          combo,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   /*
    * Intensity algorithm check button
diff --git a/plug-ins/common/ripple.c b/plug-ins/common/ripple.c
index c77f1ef..acad7e6 100644
--- a/plug-ins/common/ripple.c
+++ b/plug-ins/common/ripple.c
@@ -592,8 +592,9 @@ ripple_dialog (GimpDrawable *drawable)
                     GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
   gtk_widget_show (frame);
 
-  g_object_set_data (G_OBJECT (toggle), "inverse_sensitive", frame);
-  gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (toggle));
+  g_object_bind_property (toggle, "active",
+                          frame,  "sensitive",
+                          G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
 
   g_signal_connect_swapped (wrap, "toggled",
                             G_CALLBACK (gimp_preview_invalidate),
diff --git a/plug-ins/common/screenshot.c b/plug-ins/common/screenshot.c
index aa9a339..f58c3e3 100644
--- a/plug-ins/common/screenshot.c
+++ b/plug-ins/common/screenshot.c
@@ -1168,12 +1168,14 @@ shoot_dialog (GdkScreen **screen)
   gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 24);
   gtk_widget_show (toggle);
 
-  g_object_set_data (G_OBJECT (button), "set_sensitive", toggle);
-
   g_signal_connect (toggle, "toggled",
                     G_CALLBACK (gimp_toggle_button_update),
                     &shootvals.decorate);
 
+  g_object_bind_property (button, "active",
+                          toggle, "sensitive",
+                          G_BINDING_SYNC_CREATE);
+
 #endif /* HAVE_X11_XMU_WINUTIL_H */
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
@@ -1206,13 +1208,14 @@ shoot_dialog (GdkScreen **screen)
   gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 24);
   gtk_widget_show (toggle);
 
-  gtk_widget_set_sensitive (toggle, FALSE);
-  g_object_set_data (G_OBJECT (button), "set_sensitive", toggle);
-
   g_signal_connect (toggle, "toggled",
                     G_CALLBACK (gimp_toggle_button_update),
                     &shootvals.show_cursor);
 
+  g_object_bind_property (button, "active",
+                          toggle, "sensitive",
+                          G_BINDING_SYNC_CREATE);
+
 #endif
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
diff --git a/plug-ins/common/tile-paper.c b/plug-ins/common/tile-paper.c
index 3b7c66a..cdcab77 100644
--- a/plug-ins/common/tile-paper.c
+++ b/plug-ins/common/tile-paper.c
@@ -408,14 +408,14 @@ open_dialog (void)
                       color_button, TRUE, TRUE, 0);
   gtk_widget_show (color_button);
 
-  gtk_widget_set_sensitive (color_button,
-                            p.params.background_type == BACKGROUND_TYPE_COLOR);
-  g_object_set_data (G_OBJECT (button), "set_sensitive", color_button);
-
   g_signal_connect (color_button, "color-changed",
                     G_CALLBACK (gimp_color_button_get_color),
                     &p.params.background_color);
 
+  g_object_bind_property (button,       "active",
+                          color_button, "sensitive",
+                          G_BINDING_SYNC_CREATE);
+
   gtk_widget_show (dialog);
 
   p.run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
diff --git a/plug-ins/common/tile-small.c b/plug-ins/common/tile-small.c
index f2a12cf..0f01ad9 100644
--- a/plug-ins/common/tile-small.c
+++ b/plug-ins/common/tile-small.c
@@ -506,8 +506,9 @@ tileit_dialog (void)
                     GTK_FILL | GTK_SHRINK , GTK_FILL, 0, 0);
   gtk_widget_show (label);
 
-  gtk_widget_set_sensitive (label, FALSE);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", label);
+  g_object_bind_property (toggle, "active",
+                          label,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   spinbutton = gimp_spin_button_new (&adj, 2, 1, 6, 1, 1, 0, 1, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
@@ -521,8 +522,9 @@ tileit_dialog (void)
 
   exp_call.r_adj = adj;
 
-  gtk_widget_set_sensitive (spinbutton, FALSE);
-  g_object_set_data (G_OBJECT (label), "set_sensitive", spinbutton);
+  g_object_bind_property (toggle,     "active",
+                          spinbutton, "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   label = gtk_label_new_with_mnemonic (_("Col_umn:"));
   gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
@@ -530,8 +532,9 @@ tileit_dialog (void)
   gtk_table_attach (GTK_TABLE (table), label, 1, 2, 3, 4,
                     GTK_FILL , GTK_FILL, 0, 0);
 
-  gtk_widget_set_sensitive (label, FALSE);
-  g_object_set_data (G_OBJECT (spinbutton), "set_sensitive", label);
+  g_object_bind_property (toggle, "active",
+                          label,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   spinbutton = gimp_spin_button_new (&adj, 2, 1, 6, 1, 1, 0, 1, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
@@ -545,8 +548,9 @@ tileit_dialog (void)
 
   exp_call.c_adj = adj;
 
-  gtk_widget_set_sensitive (spinbutton, FALSE);
-  g_object_set_data (G_OBJECT (label), "set_sensitive", spinbutton);
+  g_object_bind_property (toggle,     "active",
+                          spinbutton, "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   g_object_set_data (G_OBJECT (toggle), "gimp-item-data",
                      GINT_TO_POINTER (EXPLICIT));
@@ -565,8 +569,9 @@ tileit_dialog (void)
 
   exp_call.applybut = button;
 
-  gtk_widget_set_sensitive (button, FALSE);
-  g_object_set_data (G_OBJECT (spinbutton), "set_sensitive", button);
+  g_object_bind_property (toggle,     "active",
+                          spinbutton, "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   /* Widget for selecting the Opacity */
 
diff --git a/plug-ins/gradient-flare/gradient-flare.c b/plug-ins/gradient-flare/gradient-flare.c
index 9e9b943..a8bb639 100644
--- a/plug-ins/gradient-flare/gradient-flare.c
+++ b/plug-ins/gradient-flare/gradient-flare.c
@@ -2836,12 +2836,14 @@ dlg_make_page_settings (GFlareDialog *dlg,
   gtk_container_add (GTK_CONTAINER (frame), asup_table);
   gtk_widget_show (asup_table);
 
-  gtk_widget_set_sensitive (asup_table, pvals.use_asupsample);
-  g_object_set_data (G_OBJECT (button), "set_sensitive", asup_table);
   g_signal_connect (button, "toggled",
                     G_CALLBACK (gimp_toggle_button_update),
                     &pvals.use_asupsample);
 
+  g_object_bind_property (button,     "active",
+                          asup_table, "sensitive",
+                          G_BINDING_SYNC_CREATE);
+
   adj = gimp_scale_entry_new (GTK_TABLE (asup_table), 0, 0,
                               _("_Max depth:"), -1, 4,
                               pvals.asupsample_max_depth,
@@ -3921,8 +3923,9 @@ ed_make_page_sflare (GFlareEditor *ed,
   gtk_box_pack_start (GTK_BOX (polygon_hbox), entry, FALSE, FALSE, 0);
   gtk_widget_show (entry);
 
-  gtk_widget_set_sensitive (entry, gflare->sflare_shape == GF_POLYGON);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", entry);
+  g_object_bind_property (toggle, "active",
+                          entry,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   /*
    *    Random Seed Entry
diff --git a/plug-ins/lighting/lighting-ui.c b/plug-ins/lighting/lighting-ui.c
index 88107f8..3278fbb 100644
--- a/plug-ins/lighting/lighting-ui.c
+++ b/plug-ins/lighting/lighting-ui.c
@@ -825,8 +825,9 @@ create_bump_page (void)
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  gtk_widget_set_sensitive (table, mapvals.bump_mapped);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", table);
+  g_object_bind_property (toggle, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   combo = gimp_drawable_combo_box_new (bumpmap_constrain, NULL);
   gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), mapvals.bumpmap_id,
@@ -916,8 +917,9 @@ create_environment_page (void)
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  gtk_widget_set_sensitive (table, mapvals.env_mapped);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", table);
+  g_object_bind_property (toggle, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   combo = gimp_drawable_combo_box_new (envmap_constrain, NULL);
   gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo), mapvals.envmap_id,
diff --git a/plug-ins/map-object/map-object-ui.c b/plug-ins/map-object/map-object-ui.c
index adef1ec..22db3ce 100644
--- a/plug-ins/map-object/map-object-ui.c
+++ b/plug-ins/map-object/map-object-ui.c
@@ -519,8 +519,9 @@ create_options_page (void)
   gtk_container_add (GTK_CONTAINER (frame), table);
   gtk_widget_show (table);
 
-  gtk_widget_set_sensitive (table, mapvals.antialiasing);
-  g_object_set_data (G_OBJECT (toggle), "set_sensitive", table);
+  g_object_bind_property (toggle, "active",
+                          table,  "sensitive",
+                          G_BINDING_SYNC_CREATE);
 
   adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
                               _("_Depth:"), 0, 0,



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