summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boles <dboles@src.gnome.org>2018-01-07 16:47:24 +0000
committerDaniel Boles <dboles@src.gnome.org>2018-01-07 16:47:41 +0000
commita9499dbe48e224a96733e176710b3f9c9d195447 (patch)
treefed2c4551d5d2e52a1f666b78c27800a922e2cd2
parent081488f8f2ac608dabde22493f18d99b49d4e70a (diff)
downloadgtk+-a9499dbe48e224a96733e176710b3f9c9d195447.tar.gz
ScrolledWindow: add() before remove() in snippet
We can't remove() a child widget that wasn't already add()ed, of course.
-rw-r--r--gtk/gtkscrolledwindow.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index ac06f1cc10..2fa5ef3d07 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -71,12 +71,17 @@
* If gtk_container_add() has added a #GtkViewport for you, you can remove
* both your added child widget from the #GtkViewport, and the #GtkViewport
* from the GtkScrolledWindow, like this:
+ *
* |[<!-- language="C" -->
* GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL);
* GtkWidget *child_widget = gtk_button_new ();
*
* // GtkButton is not a GtkScrollable, so GtkScrolledWindow will automatically
* // add a GtkViewport.
+ * gtk_container_add (GTK_CONTAINER (scrolled_window),
+ * child_widget);
+ *
+ * // Either of these will result in child_widget being unparented:
* gtk_container_remove (GTK_CONTAINER (scrolled_window),
* child_widget);
* // or