summaryrefslogtreecommitdiff
path: root/gtk/gtkcontainer.c
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2003-07-04 16:48:40 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2003-07-04 16:48:40 +0000
commitf91ae4ed6f22a9b530d8d253bcdb36bdc10f3395 (patch)
tree46315455cdb707aa3a2b8c9f9abeeddcf8445aba /gtk/gtkcontainer.c
parentaac21b6f6a2ac87a5577306a5c777ae980a3c4e5 (diff)
downloadgtk+-f91ae4ed6f22a9b530d8d253bcdb36bdc10f3395.tar.gz
new test for removing items
Fri Jul 4 19:06:31 2003 Soeren Sandmann <sandmann@daimi.au.dk> * tests/stresstest-toolbar.c: new test for removing items * tests/testtoolbar.c: add a popup menu * gtk/gtkcontainer.c (gtk_container_remove): add hack to avoid assert widget->parent == container when the container is a toolbar. * gtk/gtktoolbar.c (gtk_toolbar_remove_tool_item): Make much simpler. Also make correct. * gtk/gtktoolbar.c (gtk_toolbar_button_press): make popup_context_menu a boolean handled signal.
Diffstat (limited to 'gtk/gtkcontainer.c')
-rw-r--r--gtk/gtkcontainer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index b6c87b82c6..5d637210c8 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -34,6 +34,7 @@
#include "gtkmarshalers.h"
#include "gtkwindow.h"
#include "gtkintl.h"
+#include "gtktoolbar.h"
#include <gobject/gobjectnotifyqueue.c>
#include <gobject/gvaluecollector.h>
@@ -978,7 +979,13 @@ gtk_container_remove (GtkContainer *container,
{
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (widget->parent == GTK_WIDGET (container));
+
+ /* When using the deprecated API of the toolbar, it is possible
+ * to legitimately call this function with a widget that is not
+ * a direct child of the container.
+ */
+ g_return_if_fail (GTK_IS_TOOLBAR (container) ||
+ widget->parent == GTK_WIDGET (container));
g_signal_emit (container, container_signals[REMOVE], 0, widget);
}