summaryrefslogtreecommitdiff
path: root/gtk/gtkbin.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-07-07 01:25:27 +0000
committerTim Janik <timj@src.gnome.org>1998-07-07 01:25:27 +0000
commit88fba9f84531a3c38b9ad6dbc9820288cb8b6094 (patch)
treed2910e65e110f05e85f21a85f76a318ec8e4ac0b /gtk/gtkbin.c
parentda0930717e5ecc4d535e857dc70035aa8990635d (diff)
downloadgtk+-88fba9f84531a3c38b9ad6dbc9820288cb8b6094.tar.gz
totaly binary incomnpatible change:
Mon Jul 6 18:30:48 1998 Tim Janik <timj@gtk.org> * gtk/gtkbutton.h: * gtk/gtkbutton.c: GtkButtons are now derived from GtkBin. we mirror GTK_BIN (button)->child to button->child to keep source compatibility. * gtk/gtkoptionmenu.c: * gtk/gtkclist.c: * gtkcheckbutton.c: don't refer to button->child, but GTK_BIN (button)->child instead.
Diffstat (limited to 'gtk/gtkbin.c')
-rw-r--r--gtk/gtkbin.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c
index 392c160de8..4c3972bdfc 100644
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@ -203,61 +203,61 @@ gtk_bin_expose (GtkWidget *widget,
static void
gtk_bin_add (GtkContainer *container,
- GtkWidget *widget)
+ GtkWidget *child)
{
GtkBin *bin;
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_BIN (container));
- g_return_if_fail (widget != NULL);
+ g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
bin = GTK_BIN (container);
g_return_if_fail (bin->child == NULL);
- gtk_widget_set_parent (widget, GTK_WIDGET (container));
-
- if (GTK_WIDGET_VISIBLE (widget->parent))
+ gtk_widget_set_parent (child, GTK_WIDGET (bin));
+ bin->child = child;
+
+ if (GTK_WIDGET_VISIBLE (child->parent))
{
- if (GTK_WIDGET_REALIZED (widget->parent) &&
- !GTK_WIDGET_REALIZED (widget))
- gtk_widget_realize (widget);
+ if (GTK_WIDGET_REALIZED (child->parent) &&
+ !GTK_WIDGET_REALIZED (child))
+ gtk_widget_realize (child);
- if (GTK_WIDGET_MAPPED (widget->parent) &&
- !GTK_WIDGET_MAPPED (widget))
- gtk_widget_map (widget);
+ if (GTK_WIDGET_MAPPED (child->parent) &&
+ !GTK_WIDGET_MAPPED (child))
+ gtk_widget_map (child);
}
- bin->child = widget;
-
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container))
- gtk_widget_queue_resize (widget);
+ if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (container))
+ gtk_widget_queue_resize (child);
}
static void
gtk_bin_remove (GtkContainer *container,
- GtkWidget *widget)
+ GtkWidget *child)
{
GtkBin *bin;
+ gboolean widget_was_visible;
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_BIN (container));
- g_return_if_fail (widget != NULL);
+ g_return_if_fail (child != NULL);
+ g_return_if_fail (GTK_IS_WIDGET (child));
bin = GTK_BIN (container);
+ g_return_if_fail (bin->child == child);
- if (bin->child == widget)
- {
- gboolean widget_was_visible = GTK_WIDGET_VISIBLE (widget);
-
- gtk_widget_unparent (widget);
- bin->child = NULL;
-
- /* queue resize regardless of GTK_WIDGET_VISIBLE (container),
- * since that's what is needed by toplevels, which derive from GtkBin.
- */
- if (widget_was_visible)
- gtk_widget_queue_resize (GTK_WIDGET (container));
- }
+ widget_was_visible = GTK_WIDGET_VISIBLE (child);
+
+ gtk_widget_unparent (child);
+ bin->child = NULL;
+
+ /* queue resize regardless of GTK_WIDGET_VISIBLE (container),
+ * since that's what is needed by toplevels, which derive from GtkBin.
+ */
+ if (widget_was_visible)
+ gtk_widget_queue_resize (GTK_WIDGET (container));
}
static void