]> Pileus Git - ~andy/gtk/commitdiff
Remove the old widget from the tool button before overwriting it with the
authorSoeren Sandmann <sandmann@daimi.au.dk>
Thu, 22 Apr 2004 10:52:32 +0000 (10:52 +0000)
committerSøren Sandmann Pedersen <ssp@src.gnome.org>
Thu, 22 Apr 2004 10:52:32 +0000 (10:52 +0000)
Wed Apr 21 21:38:03 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

* gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
gtk_tool_button_set_icon_widget): Remove the old widget from the
tool button before overwriting it with the new widget.

(#140508, Todd Goyen)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktoolbutton.c

index 65e1c69bdbe6e76c9708f39a995a1cae0a88b5c0..846727b6b9f2a169ab1495fbe4440ac88499fd5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Apr 21 21:38:03 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
+       gtk_tool_button_set_icon_widget): Remove the old widget from the
+       tool button before overwriting it with the new widget.
+
+       (#140508, Todd Goyen)
+       
 2004-04-22  Tor Lillqvist  <tml@iki.fi>
 
        Fix the file chooser on Windows. I can't make it misbehave or
index 65e1c69bdbe6e76c9708f39a995a1cae0a88b5c0..846727b6b9f2a169ab1495fbe4440ac88499fd5c 100644 (file)
@@ -1,3 +1,11 @@
+Wed Apr 21 21:38:03 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
+       gtk_tool_button_set_icon_widget): Remove the old widget from the
+       tool button before overwriting it with the new widget.
+
+       (#140508, Todd Goyen)
+       
 2004-04-22  Tor Lillqvist  <tml@iki.fi>
 
        Fix the file chooser on Windows. I can't make it misbehave or
index 65e1c69bdbe6e76c9708f39a995a1cae0a88b5c0..846727b6b9f2a169ab1495fbe4440ac88499fd5c 100644 (file)
@@ -1,3 +1,11 @@
+Wed Apr 21 21:38:03 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
+       gtk_tool_button_set_icon_widget): Remove the old widget from the
+       tool button before overwriting it with the new widget.
+
+       (#140508, Todd Goyen)
+       
 2004-04-22  Tor Lillqvist  <tml@iki.fi>
 
        Fix the file chooser on Windows. I can't make it misbehave or
index 65e1c69bdbe6e76c9708f39a995a1cae0a88b5c0..846727b6b9f2a169ab1495fbe4440ac88499fd5c 100644 (file)
@@ -1,3 +1,11 @@
+Wed Apr 21 21:38:03 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
+       gtk_tool_button_set_icon_widget): Remove the old widget from the
+       tool button before overwriting it with the new widget.
+
+       (#140508, Todd Goyen)
+       
 2004-04-22  Tor Lillqvist  <tml@iki.fi>
 
        Fix the file chooser on Windows. I can't make it misbehave or
index 65e1c69bdbe6e76c9708f39a995a1cae0a88b5c0..846727b6b9f2a169ab1495fbe4440ac88499fd5c 100644 (file)
@@ -1,3 +1,11 @@
+Wed Apr 21 21:38:03 2004  Soeren Sandmann  <sandmann@daimi.au.dk>
+
+       * gtk/gtktoolbutton.c (gtk_tool_button_set_label_widget,
+       gtk_tool_button_set_icon_widget): Remove the old widget from the
+       tool button before overwriting it with the new widget.
+
+       (#140508, Todd Goyen)
+       
 2004-04-22  Tor Lillqvist  <tml@iki.fi>
 
        Fix the file chooser on Windows. I can't make it misbehave or
index 24fd85f52c0113452bf8536ed4dadab0addc33ab..8723f893c3455761be0c4b25f4e6023950b9735e 100644 (file)
@@ -842,8 +842,16 @@ gtk_tool_button_set_icon_widget (GtkToolButton *button,
   if (icon_widget != button->priv->icon_widget)
     {
       if (button->priv->icon_widget)
-       g_object_unref (G_OBJECT (button->priv->icon_widget));
+       {
+         if (button->priv->icon_widget->parent)
+           {
+             gtk_container_remove (GTK_CONTAINER (button->priv->icon_widget->parent),
+                                   button->priv->icon_widget);
+           }
 
+         g_object_unref (G_OBJECT (button->priv->icon_widget));
+       }
+      
       if (icon_widget)
        {
          g_object_ref (icon_widget);
@@ -881,8 +889,16 @@ gtk_tool_button_set_label_widget (GtkToolButton *button,
   if (label_widget != button->priv->label_widget)
     {
       if (button->priv->label_widget)
-       g_object_unref (button->priv->label_widget);
-
+       {
+         if (button->priv->icon_widget->parent)
+           {
+             gtk_container_remove (GTK_CONTAINER (button->priv->icon_widget->parent),
+                                   button->priv->icon_widget);
+           }
+         
+         g_object_unref (button->priv->label_widget);
+       }
+      
       if (label_widget)
        {
          g_object_ref (label_widget);