diff options
author | Havoc Pennington <hp@redhat.com> | 2001-02-09 00:40:48 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-02-09 00:40:48 +0000 |
commit | 45510aefc34ce131b5de0db7c4ebf3783d9854b4 (patch) | |
tree | 42b08773edbea6846d0d2e7e3123d85ec5fc6c1f /gtk/gtkbin.c | |
parent | 589b4726093be0f1653648110d5e40150f2e375c (diff) | |
download | gdk-pixbuf-45510aefc34ce131b5de0db7c4ebf3783d9854b4.tar.gz |
better error message if you try to add a widget to a bin that already has
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtkbin.c (gtk_bin_add): better error message if you try to
add a widget to a bin that already has a child.
* gdk/gdkcc.h, gdk/gdkcc-x11.c: Remove GdkColorContext, #50512
* docs/Changes-2.0.txt: note that GdkColorContext is gone.
* gdk/x11/Makefile.am (libgdk_x11_la_SOURCES): remove gdkcc-x11.c
* gdk/gdk.h: remove gdkcc.h
* gdk/Makefile.am (gdk_public_h_sources): remove gdkcc.h
* gtk/gtkpixmap.c (build_insensitive_pixmap): rewrite using
GdkPixbuf, since the previous implementation was GdkColorContext
dependent.
* gtk/testgtk.c (create_pixmap): add test for insensitive GtkPixmap
Diffstat (limited to 'gtk/gtkbin.c')
-rw-r--r-- | gtk/gtkbin.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 8d3e92462..ecaff82ab 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -189,7 +189,18 @@ gtk_bin_add (GtkContainer *container, g_return_if_fail (GTK_IS_WIDGET (child)); bin = GTK_BIN (container); - g_return_if_fail (bin->child == NULL); + + if (bin->child != NULL) + { + g_warning ("Attempting to add a widget with type %s to a %s, " + "but as a GtkBin subclass a %s can only contain one widget at a time; " + "it already contains a widget of type %s", + g_type_name (G_TYPE_FROM_INSTANCE (child)), + g_type_name (G_TYPE_FROM_INSTANCE (bin)), + g_type_name (G_TYPE_FROM_INSTANCE (bin)), + g_type_name (G_TYPE_FROM_INSTANCE (bin->child))); + return; + } gtk_widget_set_parent (child, GTK_WIDGET (bin)); bin->child = child; |