[gtk/wip/baedert/for-master] Avoid refering to old GtkContainer API in the docs



commit 65b79d258580e21085610cd0f89474346c9187c4
Author: Timm Bäder <mail baedert org>
Date:   Sat Aug 1 15:34:59 2020 +0200

    Avoid refering to old GtkContainer API in the docs

 gtk/gtkbutton.c         |  2 +-
 gtk/gtkflowbox.c        |  7 +++----
 gtk/gtklistbox.c        | 14 ++++++--------
 gtk/gtkoverlay.c        |  2 +-
 gtk/gtkscrolledwindow.c |  4 ++--
 gtk/gtkviewport.c       |  8 --------
 6 files changed, 13 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index ca2d0607d9..843c1f49a0 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -629,7 +629,7 @@ gtk_button_buildable_iface_init (GtkBuildableIface *iface)
  * gtk_button_new:
  *
  * Creates a new #GtkButton widget. To add a child widget to the button,
- * use gtk_container_add().
+ * use gtk_button_set_child().
  *
  * Returns: The newly created #GtkButton widget.
  */
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 2a40252675..93359aa77f 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -48,7 +48,7 @@
  * The children of a GtkFlowBox can be dynamically sorted and filtered.
  *
  * Although a GtkFlowBox must have only #GtkFlowBoxChild children,
- * you can add any kind of widget to it via gtk_container_add(), and
+ * you can add any kind of widget to it via gtk_flow_box_insert(), and
  * a GtkFlowBoxChild widget will automatically be inserted between
  * the box and the widget.
  *
@@ -4042,8 +4042,7 @@ gtk_flow_box_insert_css_node (GtkFlowBox    *box,
  * Inserts the @widget into @box at @position.
  *
  * If a sort function is set, the widget will actually be inserted
- * at the calculated position and this function has the same effect
- * as gtk_container_add().
+ * at the calculated position.
  *
  * If @position is -1, or larger than the total number of children
  * in the @box, then the @widget will be appended to the end.
@@ -4239,7 +4238,7 @@ gtk_flow_box_check_model_compat (GtkFlowBox *box)
  * If @model is %NULL, @box is left empty.
  *
  * It is undefined to add or remove widgets directly (for example, with
- * gtk_flow_box_insert() or gtk_container_add()) while @box is bound to a
+ * gtk_flow_box_insert()) while @box is bound to a
  * model.
  *
  * Note that using a model is incompatible with the filtering and sorting
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 443ac6fa2d..9283312722 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -55,7 +55,8 @@
  * button in it).
  *
  * Although a #GtkListBox must have only #GtkListBoxRow children you can
- * add any kind of widget to it via gtk_container_add(), and a #GtkListBoxRow
+ * add any kind of widget to it via gtk_list_box_prepend(),
+ * gtk_list_box_append() and gtk_list_box_insert() and a #GtkListBoxRow
  * widget will automatically be inserted between the list and the widget.
  *
  * #GtkListBoxRows can be marked as activatable or selectable. If a row
@@ -2574,8 +2575,7 @@ gtk_list_box_size_allocate (GtkWidget *widget,
  * @child: the #GtkWidget to add
  *
  * Prepend a widget to the list. If a sort function is set, the widget will
- * actually be inserted at the calculated position and this function has the
- * same effect of gtk_container_add().
+ * actually be inserted at the calculated position.
  */
 void
 gtk_list_box_prepend (GtkListBox *box,
@@ -2590,8 +2590,7 @@ gtk_list_box_prepend (GtkListBox *box,
  * @child: the #GtkWidget to add
  *
  * Append a widget to the list. If a sort function is set, the widget will
- * actually be inserted at the calculated position and this function has the
- * same effect of gtk_container_add().
+ * actually be inserted at the calculated position.
  */
 void
 gtk_list_box_append (GtkListBox *box,
@@ -2607,8 +2606,7 @@ gtk_list_box_append (GtkListBox *box,
  * @position: the position to insert @child in
  *
  * Insert the @child into the @box at @position. If a sort function is
- * set, the widget will actually be inserted at the calculated position and
- * this function has the same effect of gtk_container_add().
+ * set, the widget will actually be inserted at the calculated position.
  *
  * If @position is -1, or larger than the total number of items in the
  * @box, then the @child will be appended to the end.
@@ -3578,7 +3576,7 @@ gtk_list_box_check_model_compat (GtkListBox *box)
  * If @model is %NULL, @box is left empty.
  *
  * It is undefined to add or remove widgets directly (for example, with
- * gtk_list_box_insert() or gtk_container_add()) while @box is bound to a
+ * gtk_list_box_insert()) while @box is bound to a
  * model.
  *
  * Note that using a model is incompatible with the filtering and sorting
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index c1c641f012..050b8fd7ac 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -420,7 +420,7 @@ gtk_overlay_new (void)
  * Adds @widget to @overlay.
  *
  * The widget will be stacked on top of the main widget
- * added with gtk_container_add().
+ * added with gtk_overlay_set_child().
  *
  * The position at which @widget is placed is determined
  * from its #GtkWidget:halign and #GtkWidget:valign properties.
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index eaac60a1f2..a2f8fcaf4e 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -68,12 +68,12 @@
  * Widgets with native scrolling support, i.e. those whose classes implement the
  * #GtkScrollable interface, are added directly. For other types of widget, the
  * class #GtkViewport acts as an adaptor, giving scrollability to other widgets.
- * GtkScrolledWindow’s implementation of gtk_container_add() intelligently
+ * gtk_scrolled_window_set_child() intelligently
  * accounts for whether or not the added child is a #GtkScrollable. If it isn’t,
  * #GtkScrolledWindow wraps the child in a #GtkViewport and adds that for you.
  * Therefore, you can just add any child widget and not worry about the details.
  *
- * If gtk_container_add() has added a #GtkViewport for you, you can remove
+ * If gtk_scrolled_window_set_child() 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:
  *
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index e9f6a8cda5..f53a504c5e 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -49,14 +49,6 @@
  * capabilities. Use GtkViewport to scroll child widgets such as
  * #GtkGrid, #GtkBox, and so on.
  *
- * If a widget has native scrolling abilities, such as #GtkTextView,
- * #GtkTreeView or #GtkIconView, it can be added to a #GtkScrolledWindow
- * with gtk_container_add(). If a widget does not, you must first add the
- * widget to a #GtkViewport, then add the viewport to the scrolled window.
- * gtk_container_add() does this automatically if a child that does not
- * implement #GtkScrollable is added to a #GtkScrolledWindow, so you can
- * ignore the presence of the viewport.
- *
  * The GtkViewport will start scrolling content only if allocated less
  * than the child widget’s minimum size in a given orientation.
  *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]