summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1998-02-10 04:17:10 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-02-10 04:17:10 +0000
commitf98686da856ea0c0dfb6050f233c0cb02ee8c861 (patch)
tree8ab8e1b0ebaf90368f6c6e2a91d9d6edef62a78e
parent6246db92880e152e6ccbb4583162c96143d88e8d (diff)
downloadgtk+-f98686da856ea0c0dfb6050f233c0cb02ee8c861.tar.gz
Check for the RESIZE_NEEDED flag and remove the widget from the list.
Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu> * gtk/gtkwidget.c (gtk_widget_unparent): Check for the RESIZE_NEEDED flag and remove the widget from the list. Remove the check from gtk_widget_destroy (no longer needed). * Unrealize widget _before_ calling "destroy" signal, and unset VISIBLE flag. * Unrealize child widgets _after_ unrealizing parent to improve visual appearance.
-rw-r--r--ChangeLog14
-rw-r--r--ChangeLog.pre-2-014
-rw-r--r--ChangeLog.pre-2-1014
-rw-r--r--ChangeLog.pre-2-214
-rw-r--r--ChangeLog.pre-2-414
-rw-r--r--ChangeLog.pre-2-614
-rw-r--r--ChangeLog.pre-2-814
-rw-r--r--gtk/gtkwidget.c45
8 files changed, 120 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index fd06441f0a..d6f2beb9d6 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,15 @@
+Mon Feb 9 23:08:16 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Check for
+ the RESIZE_NEEDED flag and remove the widget from the list.
+ Remove the check from gtk_widget_destroy (no longer needed).
+
+ * Unrealize widget _before_ calling "destroy" signal, and
+ unset VISIBLE flag.
+
+ * Unrealize child widgets _after_ unrealizing parent to improve
+ visual appearance.
+
Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
@@ -6,7 +18,7 @@ Mon Feb 9 16:42:21 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
Sun Feb 8 07:06:54 1998 Tim Janik <timj@gimp.org>
- * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
+ * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new function to return
the widget that the menu is attached to.
Sat Feb 7 11:33:08 1998 Owen Taylor <owt1@cornell.edu>
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 427ee28200..9e83890115 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -1085,6 +1085,13 @@ gtk_widget_unparent (GtkWidget *widget)
if (child == widget)
gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
}
+
+ if (GTK_WIDGET_RESIZE_NEEDED (widget))
+ {
+ GTK_CONTAINER (toplevel)->resize_widgets =
+ g_slist_remove (GTK_CONTAINER (toplevel)->resize_widgets, widget);
+ GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_NEEDED);
+ }
if (widget->window &&
GTK_WIDGET_NO_WINDOW (widget) &&
@@ -1117,9 +1124,23 @@ gtk_widget_destroy (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
+ GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
+ if (GTK_WIDGET_REALIZED (widget))
+ gtk_widget_unrealize (widget);
+
gtk_object_destroy (GTK_OBJECT (widget));
}
+/*****************************************
+ * gtk_widget_destroyed:
+ * Utility function: sets widget_pointer
+ * to NULL when widget is destroyed.
+ *
+ * arguments:
+ *
+ * results:
+ *****************************************/
+
void
gtk_widget_destroyed (GtkWidget *widget,
GtkWidget **widget_pointer)
@@ -3091,22 +3112,11 @@ gtk_widget_real_destroy (GtkObject *object)
GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_PENDING);
}
- if (GTK_WIDGET_RESIZE_NEEDED (widget))
- {
- GtkWidget *toplevel;
-
- toplevel = gtk_widget_get_toplevel (widget);
- GTK_CONTAINER (toplevel)->resize_widgets =
- g_slist_remove (GTK_CONTAINER (toplevel)->resize_widgets, widget);
- GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_NEEDED);
- }
-
if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
gtk_widget_shape_combine_mask (widget, NULL, -1, -1);
gtk_grab_remove (widget);
gtk_selection_remove_all (widget);
- gtk_widget_unrealize (widget);
if (widget->parent)
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
@@ -3316,11 +3326,6 @@ gtk_widget_real_unrealize (GtkWidget *widget)
/* printf ("unrealizing %s\n", gtk_type_name (GTK_OBJECT(widget)->klass->type));
*/
- if (GTK_IS_CONTAINER (widget))
- gtk_container_foreach (GTK_CONTAINER (widget),
- (GtkCallback)gtk_widget_unrealize,
- NULL);
-
gtk_style_detach (widget->style);
if (!GTK_WIDGET_NO_WINDOW (widget))
{
@@ -3331,6 +3336,14 @@ gtk_widget_real_unrealize (GtkWidget *widget)
{
gdk_window_unref (widget->window);
}
+
+ /* Unrealize afterwards to improve visual effect */
+
+ if (GTK_IS_CONTAINER (widget))
+ gtk_container_foreach (GTK_CONTAINER (widget),
+ (GtkCallback)gtk_widget_unrealize,
+ NULL);
+
widget->window = NULL;
}