From aa49527fa78bf5b3a3f1394092b248e27e1bfa3f Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 19 Jul 2001 14:57:15 +0000 Subject: Enforce the widget/child realization/mapping invariants. Sat Jul 7 02:50:14 2001 Owen Taylor * gtk/gtkwidget.c (gtk_widget_set_parent): Enforce the widget/child realization/mapping invariants. * gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions gtk_widget_[get/set]_child_visible() to control whether visible children of a mapped window are mapped. * docs/widget_system.txt: Updated for changes in container contract, and addition of GTK_CHILD_VISIBLE. * gtk/gtkcontainer.c: Add generic map()/unmap() functions that work for almost all containers. * gtk/gtknotebook.c gtk/gtkpacker.c: Use gtk_widget_set_child_visible() where necessary. * gtk/*.c: Remove excess map(), unmap(), and realization/mapping invariant enforcing code from many containers. --- gtk/gtktree.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'gtk/gtktree.c') diff --git a/gtk/gtktree.c b/gtk/gtktree.c index 1e369eaacb..d3f605fa23 100644 --- a/gtk/gtktree.c +++ b/gtk/gtktree.c @@ -228,17 +228,6 @@ gtk_tree_insert (GtkTree *tree, tree->children = g_list_insert (tree->children, tree_item, position); gtk_widget_set_parent (tree_item, GTK_WIDGET (tree)); - - if (GTK_WIDGET_REALIZED (tree_item->parent)) - gtk_widget_realize (tree_item); - - if (GTK_WIDGET_VISIBLE (tree_item->parent) && GTK_WIDGET_VISIBLE (tree_item)) - { - if (GTK_WIDGET_MAPPED (tree_item->parent)) - gtk_widget_map (tree_item); - - gtk_widget_queue_resize (tree_item); - } } static void @@ -256,17 +245,6 @@ gtk_tree_add (GtkContainer *container, gtk_widget_set_parent (child, GTK_WIDGET (container)); - if (GTK_WIDGET_REALIZED (child->parent)) - gtk_widget_realize (child); - - if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child)) - { - if (GTK_WIDGET_MAPPED (child->parent)) - gtk_widget_map (child); - - gtk_widget_queue_resize (child); - } - if (!tree->selection && (tree->selection_mode == GTK_SELECTION_BROWSE)) gtk_tree_select_child (tree, child); } -- cgit v1.2.1