Commit 56e79739 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Improve GtkBox and GtkTable docs a bit

This adds some details gleaned from the tutorial, before its
impending demise.
parent 17ffcb0c
...@@ -22,8 +22,11 @@ convenient (but slightly less flexible) gtk_table_attach_defaults(). ...@@ -22,8 +22,11 @@ convenient (but slightly less flexible) gtk_table_attach_defaults().
To alter the space next to a specific row, use gtk_table_set_row_spacing(), To alter the space next to a specific row, use gtk_table_set_row_spacing(),
and for a column, gtk_table_set_col_spacing().</para> and for a column, gtk_table_set_col_spacing().</para>
<para> <para>
The gaps between <emphasis>all</emphasis> rows or columns can be changed by calling The gaps between <emphasis>all</emphasis> rows or columns can be changed by
gtk_table_set_row_spacings() or gtk_table_set_col_spacings() respectively. calling gtk_table_set_row_spacings() or gtk_table_set_col_spacings()
respectively. Note that spacing is added <emphasis>between</emphasis> the
children, while padding added by gtk_table_atach() is added <emphasis>on
either side</emphasis> of the widget it belongs to.
</para> </para>
<para> <para>
gtk_table_set_homogeneous(), can be used to set whether all cells in the gtk_table_set_homogeneous(), can be used to set whether all cells in the
...@@ -169,6 +172,17 @@ specified by @left_attach, @right_attach, @top_attach and @bottom_attach. ...@@ -169,6 +172,17 @@ specified by @left_attach, @right_attach, @top_attach and @bottom_attach.
These each represent the leftmost, rightmost, uppermost and lowest column These each represent the leftmost, rightmost, uppermost and lowest column
and row numbers of the table. (Columns and rows are indexed from zero). and row numbers of the table. (Columns and rows are indexed from zero).
</para> </para>
<para>
To make a button occupy the lower right cell of a 2x2 table, use
<informalexample><programlisting>
gtk_table_attach (table, button,
1, 2, /* left, right attach */
1, 2, /* top, bottom attach */
xoptions, yoptions,
xpadding, ypadding);
</programlisting></informalexample>
If you want to make the button span the entire bottom row, use @left_attach == 0 and @right_attach = 2 instead.
</para>
@table: The #GtkTable to add a new widget to. @table: The #GtkTable to add a new widget to.
@child: The widget to add. @child: The widget to add.
......
...@@ -63,7 +63,10 @@ ...@@ -63,7 +63,10 @@
* of the GtkBox are forced to get the same amount of space. * of the GtkBox are forced to get the same amount of space.
* *
* Use gtk_box_set_spacing() to determine how much space will be * Use gtk_box_set_spacing() to determine how much space will be
* minimally placed between all children in the GtkBox. * minimally placed between all children in the GtkBox. Note that
* spacing is added <emphasis>between</emphasis> the children, while
* padding added by gtk_box_pack_start() or gtk_box_pack_end() is added
* <emphasis>on either side</emphasis> of the widget it belongs to.
* *
* Use gtk_box_reorder_child() to move a GtkBox child to a different * Use gtk_box_reorder_child() to move a GtkBox child to a different
* place in the box. * place in the box.
...@@ -1256,22 +1259,22 @@ gtk_box_new (GtkOrientation orientation, ...@@ -1256,22 +1259,22 @@ gtk_box_new (GtkOrientation orientation,
* gtk_box_pack_start: * gtk_box_pack_start:
* @box: a #GtkBox * @box: a #GtkBox
* @child: the #GtkWidget to be added to @box * @child: the #GtkWidget to be added to @box
* @expand: %TRUE if the new child is to be given extra space allocated to * @expand: %TRUE if the new child is to be given extra space allocated
* @box. The extra space will be divided evenly between all children of * to @box. The extra space will be divided evenly between all children
* @box that use this option * that use this option
* @fill: %TRUE if space given to @child by the @expand option is * @fill: %TRUE if space given to @child by the @expand option is
* actually allocated to @child, rather than just padding it. This * actually allocated to @child, rather than just padding it. This
* parameter has no effect if @expand is set to %FALSE. A child is * parameter has no effect if @expand is set to %FALSE. A child is
* always allocated the full height of a #GtkHBox and the full width * always allocated the full height of a #GtkHBox and the full width
* of a #GtkVBox. This option affects the other dimension * of a #GtkVBox. This option affects the other dimension
* @padding: extra space in pixels to put between this child and its * @padding: extra space in pixels to put between this child and its
* neighbors, over and above the global amount specified by * neighbors, over and above the global amount specified by
* #GtkBox:spacing property. If @child is a widget at one of the * #GtkBox:spacing property. If @child is a widget at one of the
* reference ends of @box, then @padding pixels are also put between * reference ends of @box, then @padding pixels are also put between
* @child and the reference edge of @box * @child and the reference edge of @box
* *
* Adds @child to @box, packed with reference to the start of @box. * Adds @child to @box, packed with reference to the start of @box.
* The @child is packed after any other child packed with reference * The @child is packed after any other child packed with reference
* to the start of @box. * to the start of @box.
*/ */
void void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment