summaryrefslogtreecommitdiff
path: root/gtk/gtkbox.c
diff options
context:
space:
mode:
authorDaniel Boles <dboles.src@gmail.com>2018-12-04 20:37:08 +0000
committerDaniel Boles <dboles.src@gmail.com>2018-12-04 20:43:19 +0000
commit72d09d22e934c52ff301c0754078f1e42e97bc69 (patch)
tree97033def8d25cb206052ae369c3b6a4bac992d0e /gtk/gtkbox.c
parenta2a4603329b42354fed7b73feda7d513a0f00c0f (diff)
downloadgtk+-72d09d22e934c52ff301c0754078f1e42e97bc69.tar.gz
Box, Grid: Improve various bits of documentation
Issue #1495 showed that the docs of GtkGrid retain outdated implications that (as was once, but is no longer, the case) it is intended to replace GtkBox, by discussing HfW and widget properties in a way that suggests GtkBox can't handle them. But of course it does, and it's preferable for simple single-row/column cases. Worse, we said GtkGrid “provides exactly the same functionality” for the latter case, but the original point of that Issues was that it doesn’t, at least for CSS positional selectors! Box: • Use an actually meaningful @Short_description. • Remove unhelpful @See_also references to unrelated containers. • Remove references to “rectangular area”: it might be another shape via CSS, or “rectangular” might falsely imply 2 dimensions of children. • Mention Orientable:orientation. • Emphasise usefulness of :[hv]align for allocating in the other axis. • Don’t say that Grid “provides exactly the same functionality” for a single row or column, since (A) it is overkill for that case and (B) said Issue proved that it *doesn’t* for CSS child order, for example. Grid: • Don’t dwell on widget properties and height-for-width in a way that wrongly implies that Box can’t handle those (or Grid can better). In fact, just get rid of that bit altogether: Box handles them fine, and such wording was only needed years ago for migration from GTK+ 2 to 3. • Point to GtkBox as being preferred for the simple row/column use case.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r--gtk/gtkbox.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 21f0d226ce..fdf000db2c 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -24,16 +24,15 @@
/**
* SECTION:gtkbox
- * @Short_description: A container box
+ * @Short_description: A container for packing widgets in a single row or column
* @Title: GtkBox
- * @See_also: #GtkFrame, #GtkGrid, #GtkLayout
+ * @See_also: #GtkGrid
*
- * The GtkBox widget organizes child widgets into a rectangular area.
- *
- * The rectangular area of a GtkBox is organized into either a single row
- * or a single column of child widgets depending upon the orientation.
- * Thus, all children of a GtkBox are allocated one dimension in common,
- * which is the height of a row, or the width of a column.
+ * The GtkBox widget arranges child widgets into a single row or column,
+ * depending upon the value of its #GtkOrientable:orientation property. Within
+ * the other dimension, all children are allocated the same size. Of course,
+ * the #GtkWidget:halign and #GtkWidget:valign properties can be used on
+ * the children to influence their allocation.
*
* GtkBox uses a notion of packing. Packing refers
* to adding widgets with reference to a particular position in a
@@ -62,9 +61,6 @@
* Use gtk_box_reorder_child() to move a GtkBox child to a different
* place in the box.
*
- * Note that a single-row or single-column #GtkGrid provides exactly
- * the same functionality as #GtkBox.
- *
* # CSS nodes
*
* GtkBox uses a single CSS node with name box.