diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-07-19 14:57:15 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-07-19 14:57:15 +0000 |
commit | aa49527fa78bf5b3a3f1394092b248e27e1bfa3f (patch) | |
tree | a1b7651c9e379ab1f7ffe2af68727cdccdf682e6 /gtk/gtkbox.c | |
parent | 8f2bf7976d73ba58b808002268c49a19e9b586ee (diff) | |
download | gtk+-aa49527fa78bf5b3a3f1394092b248e27e1bfa3f.tar.gz |
Enforce the widget/child realization/mapping invariants.
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* 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.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r-- | gtk/gtkbox.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index b161bce0e5..ad309dfa50 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -52,8 +52,6 @@ static void gtk_box_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void gtk_box_map (GtkWidget *widget); -static void gtk_box_unmap (GtkWidget *widget); static void gtk_box_add (GtkContainer *container, GtkWidget *widget); static void gtk_box_remove (GtkContainer *container, @@ -115,9 +113,6 @@ gtk_box_class_init (GtkBoxClass *class) gobject_class->set_property = gtk_box_set_property; gobject_class->get_property = gtk_box_get_property; - widget_class->map = gtk_box_map; - widget_class->unmap = gtk_box_unmap; - container_class->add = gtk_box_add; container_class->remove = gtk_box_remove; container_class->forall = gtk_box_forall; @@ -378,16 +373,6 @@ gtk_box_pack_start (GtkBox *box, gtk_widget_set_parent (child, GTK_WIDGET (box)); - if (GTK_WIDGET_REALIZED (box)) - gtk_widget_realize (child); - - if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child)) - { - if (GTK_WIDGET_MAPPED (box)) - gtk_widget_map (child); - - gtk_widget_queue_resize (child); - } gtk_widget_child_notify (child, "expand"); gtk_widget_child_notify (child, "fill"); gtk_widget_child_notify (child, "padding"); @@ -423,16 +408,6 @@ gtk_box_pack_end (GtkBox *box, gtk_widget_set_parent (child, GTK_WIDGET (box)); - if (GTK_WIDGET_REALIZED (box)) - gtk_widget_realize (child); - - if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child)) - { - if (GTK_WIDGET_MAPPED (box)) - gtk_widget_map (child); - - gtk_widget_queue_resize (child); - } gtk_widget_child_notify (child, "expand"); gtk_widget_child_notify (child, "fill"); gtk_widget_child_notify (child, "padding"); @@ -668,54 +643,6 @@ gtk_box_set_child_packing (GtkBox *box, } static void -gtk_box_map (GtkWidget *widget) -{ - GtkBox *box; - GtkBoxChild *child; - GList *children; - - g_return_if_fail (GTK_IS_BOX (widget)); - - box = GTK_BOX (widget); - GTK_WIDGET_SET_FLAGS (box, GTK_MAPPED); - - children = box->children; - while (children) - { - child = children->data; - children = children->next; - - if (GTK_WIDGET_VISIBLE (child->widget) && - !GTK_WIDGET_MAPPED (child->widget)) - gtk_widget_map (child->widget); - } -} - -static void -gtk_box_unmap (GtkWidget *widget) -{ - GtkBox *box; - GtkBoxChild *child; - GList *children; - - g_return_if_fail (GTK_IS_BOX (widget)); - - box = GTK_BOX (widget); - GTK_WIDGET_UNSET_FLAGS (box, GTK_MAPPED); - - children = box->children; - while (children) - { - child = children->data; - children = children->next; - - if (GTK_WIDGET_VISIBLE (child->widget) && - GTK_WIDGET_MAPPED (child->widget)) - gtk_widget_unmap (child->widget); - } -} - -static void gtk_box_add (GtkContainer *container, GtkWidget *widget) { |