[gtk+] ScrolledWindow: add() before remove() in snippet
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] ScrolledWindow: add() before remove() in snippet
- Date: Sun, 7 Jan 2018 16:49:29 +0000 (UTC)
commit b89bf98731e67921c5f4a328807d2d9fda189898
Author: Daniel Boles <dboles src gnome org>
Date: Sun Jan 7 16:47:24 2018 +0000
ScrolledWindow: add() before remove() in snippet
We can't remove() a child widget that wasn't already add()ed, of course.
gtk/gtkscrolledwindow.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 4f9933e..b2f90d0 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -69,12 +69,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]