diff --git a/docs/reference/gtk/tmpl/gtktable.sgml b/docs/reference/gtk/tmpl/gtktable.sgml index 7a8584352a..a95a3199f6 100644 --- a/docs/reference/gtk/tmpl/gtktable.sgml +++ b/docs/reference/gtk/tmpl/gtktable.sgml @@ -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(), and for a column, gtk_table_set_col_spacing(). -The gaps between all rows or columns can be changed by calling -gtk_table_set_row_spacings() or gtk_table_set_col_spacings() respectively. +The gaps between all rows or columns can be changed by +calling gtk_table_set_row_spacings() or gtk_table_set_col_spacings() +respectively. Note that spacing is added between the +children, while padding added by gtk_table_atach() is added on +either side of the widget it belongs to. 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. These each represent the leftmost, rightmost, uppermost and lowest column and row numbers of the table. (Columns and rows are indexed from zero). + +To make a button occupy the lower right cell of a 2x2 table, use + +gtk_table_attach (table, button, + 1, 2, /* left, right attach */ + 1, 2, /* top, bottom attach */ + xoptions, yoptions, + xpadding, ypadding); + +If you want to make the button span the entire bottom row, use @left_attach == 0 and @right_attach = 2 instead. + @table: The #GtkTable to add a new widget to. @child: The widget to add. diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index ae00779ac6..a083af18c6 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -63,7 +63,10 @@ * of the GtkBox are forced to get the same amount of space. * * 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 between the children, while + * padding added by gtk_box_pack_start() or gtk_box_pack_end() is added + * on either side of the widget it belongs to. * * Use gtk_box_reorder_child() to move a GtkBox child to a different * place in the box. @@ -1256,22 +1259,22 @@ gtk_box_new (GtkOrientation orientation, * gtk_box_pack_start: * @box: a #GtkBox * @child: the #GtkWidget to be added to @box - * @expand: %TRUE if the new child is to be given extra space allocated to - * @box. The extra space will be divided evenly between all children of - * @box that use this option + * @expand: %TRUE if the new child is to be given extra space allocated + * to @box. The extra space will be divided evenly between all children + * that use this option * @fill: %TRUE if space given to @child by the @expand option is - * actually allocated to @child, rather than just padding it. This - * 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 - * of a #GtkVBox. This option affects the other dimension + * actually allocated to @child, rather than just padding it. This + * 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 + * of a #GtkVBox. This option affects the other dimension * @padding: extra space in pixels to put between this child and its * neighbors, over and above the global amount specified by - * #GtkBox:spacing property. If @child is a widget at one of the - * reference ends of @box, then @padding pixels are also put between + * #GtkBox:spacing property. If @child is a widget at one of the + * reference ends of @box, then @padding pixels are also put between * @child and the reference edge 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. */ void