summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2018-11-19 13:48:36 +0100
committerBenjamin Berg <bberg@redhat.com>2018-11-19 13:58:34 +0100
commit8c9c3e4426269c34a778b9aa077e3649014916c2 (patch)
tree3582533ccd7fcb3adce00ede2f2cfbce0eabab27
parentd0f4fcb6fddd813308de3317df708c7a6fc6ec3b (diff)
downloadgtk+-8c9c3e4426269c34a778b9aa077e3649014916c2.tar.gz
container: Document that removal from foreach is permissible
It is permissable to remove a widget using gtk_container_remove from the gtk_container_foreach callback handler. Document this fact to make it more discoverable. Fixes #1461
-rw-r--r--gtk/gtkcontainer.c2
-rw-r--r--gtk/gtkcontainer.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 7bb9524658..20f75f4ca7 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1574,6 +1574,8 @@ gtk_container_forall (GtkContainer *container,
* added to the container by the application with explicit add()
* calls.
*
+ * It is permissible to remove the child from the @callback handler.
+ *
* Most applications should use gtk_container_foreach(),
* rather than gtk_container_forall().
**/
diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h
index 37d49805cc..8f07f97408 100644
--- a/gtk/gtkcontainer.h
+++ b/gtk/gtkcontainer.h
@@ -57,7 +57,8 @@ struct _GtkContainer
* @add: Signal emitted when a widget is added to container.
* @remove: Signal emitted when a widget is removed from container.
* @check_resize: Signal emitted when a size recalculation is needed.
- * @forall: Invokes callback on each child of container.
+ * @forall: Invokes callback on each child of container. The callback handler
+ * may remove the child.
* @set_focus_child: Sets the focused child of container.
* @child_type: Returns the type of the children supported by the container.
* @set_child_property: Set a property on a child of container.