From 10c8c709d38fbafb5e16bcdcada56dc8cd78bc4f Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 10 Jun 2006 17:48:33 +0000 Subject: [PATCH] simply use gimp_button_new() instead of g_object_new(). Don't set the 2006-06-10 Michael Natterer * app/widgets/gimpeditor.c (gimp_editor_add_action_button): simply use gimp_button_new() instead of g_object_new(). Don't set the "use-stock" property and reordered some code. Keeps GtkButton from thinking that is has constructed the button's child itself and thus makes the function more rubust against changes in GtkButton. --- ChangeLog | 8 ++++++++ app/widgets/gimpeditor.c | 16 +++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20f0ebc2fa..0c965cd3ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-10 Michael Natterer + + * app/widgets/gimpeditor.c (gimp_editor_add_action_button): simply + use gimp_button_new() instead of g_object_new(). Don't set the + "use-stock" property and reordered some code. Keeps GtkButton from + thinking that is has constructed the button's child itself and + thus makes the function more rubust against changes in GtkButton. + 2006-06-10 Bill Skaggs * app/tools/gimpcroptool.c diff --git a/app/widgets/gimpeditor.c b/app/widgets/gimpeditor.c index 85e3e07135..cdf6b6f79c 100644 --- a/app/widgets/gimpeditor.c +++ b/app/widgets/gimpeditor.c @@ -615,22 +615,14 @@ gimp_editor_add_action_button (GimpEditor *editor, } else { - button = g_object_new (GIMP_TYPE_BUTTON, - "use-stock", TRUE, - NULL); + button = gimp_button_new (); } - gtk_action_connect_proxy (action, button); - gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0); - gtk_widget_show (button); - g_object_get (action, "stock-id", &stock_id, "tooltip", &tooltip, NULL); - help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID); - old_child = gtk_bin_get_child (GTK_BIN (button)); if (old_child) @@ -642,6 +634,10 @@ gimp_editor_add_action_button (GimpEditor *editor, g_free (stock_id); + gtk_action_connect_proxy (action, button); + gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0); + gtk_widget_show (button); + va_start (args, action_name); action_name = va_arg (args, const gchar *); @@ -698,6 +694,8 @@ gimp_editor_add_action_button (GimpEditor *editor, NULL); } + help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID); + if (tooltip || help_id) gimp_help_set_help_data (button, tooltip, help_id);