## GtkButtonBox GtkButtonBox — Base class for GtkHButtonBox and GtkVButtonBox |

## Synopsis

    #include <gtk/gtk.h>

                GtkButtonBox;
    #define     GTK_BUTTONBOX_DEFAULT
    #define     gtk_button_box_get_spacing      (b)
    GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget);
    void        gtk_button_box_get_child_size   (GtkButtonBox *widget,
                                                 gint *min_width,
                                                 gint *min_height);
    void        gtk_button_box_get_child_ipadding
                                                (GtkButtonBox *widget,
                                                 gint *ipad_x,
                                                 gint *ipad_y);
    gboolean    gtk_button_box_get_child_secondary
                                                (GtkButtonBox *widget,
                                                 GtkWidget *child);
    #define     gtk_button_box_set_spacing      (b,s)
    void        gtk_button_box_set_layout       (GtkButtonBox *widget,
                                                 GtkButtonBoxStyle layout_style);
    void        gtk_button_box_set_child_size   (GtkButtonBox *widget,
                                                 gint min_width,
                                                 gint min_height);
    void        gtk_button_box_set_child_ipadding
                                                (GtkButtonBox *widget,
                                                 gint ipad_x,
                                                 gint ipad_y);
    void        gtk_button_box_set_child_secondary
                                                (GtkButtonBox *widget,
                                                 GtkWidget *child,
                                                 gboolean is_secondary);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBox
                               +----GtkButtonBox
                                     +----GtkHButtonBox
                                     +----GtkVButtonBox

## Implemented Interfaces

GtkButtonBox implements AtkImplementorIface.

## Properties

      "layout-style"         GtkButtonBoxStyle     : Read / Write

## Child Properties

      "secondary"            gboolean              : Read / Write

## Style Properties

      "child-internal-pad-x" gint                  : Read
      "child-internal-pad-y" gint                  : Read
      "child-min-height"     gint                  : Read
      "child-min-width"      gint                  : Read

## Description

The primary purpose of this class is to keep track of the various properties of GtkHButtonBox and GtkVButtonBox widgets.

`gtk_button_box_get_child_size()` retrieves the minimum width and height for widgets in a given button box. `gtk_button_box_set_child_size()` allows those properties to be changed.

The internal padding of buttons can be retrieved and changed per button box using `gtk_button_box_get_child_ipadding()` and `gtk_button_box_set_child_ipadding()` respectively.

`gtk_button_box_get_spacing()` and `gtk_button_box_set_spacing()` retrieve and change default number of pixels between buttons, respectively.

`gtk_button_box_get_layout()` and `gtk_button_box_set_layout()` retrieve and alter the method used to spread the buttons in a button box across the container, respectively.

## Details

### GtkButtonBox

    typedef struct _GtkButtonBox GtkButtonBox;

This is a read-only struct; no members should be modified directly.

### GTK_BUTTONBOX_DEFAULT

    #define GTK_BUTTONBOX_DEFAULT -1

Used internally only.

### gtk_button_box_get_spacing()

    #define gtk_button_box_get_spacing(b)   gtk_box_get_spacing (GTK_BOX (b))

### Warning

`gtk_button_box_get_spacing` is deprecated and should not be used in newly-written code.

Retrieves how much space a button box is placing between each child button.

`b` : |
Returns : | the current spacing applied to the buttons in `widget`.

### gtk_button_box_get_layout ()

    GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget);

Retrieves the method being used to arrange the buttons in a button box.

`widget` : | a GtkButtonBox.
Returns : | the method used to layout buttons in `widget`.

### gtk_button_box_get_child_size ()

    void        gtk_button_box_get_child_size   (GtkButtonBox *widget,
                                                 gint *min_width,
                                                 gint *min_height);

### Warning

`gtk_button_box_get_child_size` is deprecated and should not be used in newly-written code. Use the style properties `"child-min-width/-height"` instead.

Retrieves the current width and height of all child widgets in a button box. `min_width` and `min_height` are filled with those values, respectively.

`widget` : | a GtkButtonBox.
`min_width` : | the width of the buttons contained by `widget`.
`min_height` : | the height of the buttons contained by `widget`.

### gtk_button_box_get_child_ipadding ()

    void        gtk_button_box_get_child_ipadding
                                                (GtkButtonBox *widget,
                                                 gint *ipad_x,
                                                 gint *ipad_y);

### Warning

`gtk_button_box_get_child_ipadding` is deprecated and should not be used in newly-written code. Use the style properties `"child-internal-pad-x/-y"` instead.

Gets the default number of pixels that pad the buttons in a given button box.

`widget` : | a GtkButtonBox.
`ipad_x` : | the horizontal padding used by buttons in `widget`.
`ipad_y` : | the vertical padding used by buttons in `widget`.

### gtk_button_box_get_child_secondary ()

    gboolean    gtk_button_box_get_child_secondary
                                                (GtkButtonBox *widget,
                                                 GtkWidget *child);

Returns whether `child` should appear in a secondary group of children.

`widget` : | a GtkButtonBox
`child` : | a child of `widget`
Returns : | whether `child` should appear in a secondary group of children.

Since 2.4

### gtk_button_box_set_spacing()

    #define gtk_button_box_set_spacing(b,s) gtk_box_set_spacing (GTK_BOX (b), s)

### Warning

`gtk_button_box_set_spacing` is deprecated and should not be used in newly-written code.

Sets the amount of spacing between buttons in a given button box.

`b` : |
`s` : |

### gtk_button_box_set_layout ()

    void        gtk_button_box_set_layout       (GtkButtonBox *widget,
                                                 GtkButtonBoxStyle layout_style);

Changes the way buttons are arranged in their container.

`widget` : | a GtkButtonBox.
`layout_style` : | the new layout style.

### gtk_button_box_set_child_size ()

    void        gtk_button_box_set_child_size   (GtkButtonBox *widget,
                                                 gint min_width,
                                                 gint min_height);

### Warning

`gtk_button_box_set_child_size` is deprecated and should not be used in newly-written code. Use the style properties `"child-min-width/-height"` instead.

Sets a new default size for the children of a given button box.

`widget` : | a GtkButtonBox.
`min_width` : | a default width for buttons in `widget`.
`min_height` : | a default height for buttons in `widget`.

### gtk_button_box_set_child_ipadding ()

    void        gtk_button_box_set_child_ipadding
                                                (GtkButtonBox *widget,
                                                 gint ipad_x,
                                                 gint ipad_y);

### Warning

`gtk_button_box_set_child_ipadding` is deprecated and should not be used in newly-written code. Use the style properties `"child-internal-pad-x/-y"` instead.

Changes the amount of internal padding used by all buttons in a given button box.

`widget` : | a GtkButtonBox.
`ipad_x` : | the horizontal padding that should be used by each button in `widget`.
`ipad_y` : | the vertical padding that should be used by each button in `widget`.

### gtk_button_box_set_child_secondary ()

    void        gtk_button_box_set_child_secondary
                                                (GtkButtonBox *widget,
                                                 GtkWidget *child,
                                                 gboolean is_secondary);

Sets whether `child` should appear in a secondary group of children. A typical use of a secondary child is the help button in a dialog.

This group appears after the other children if the style is `GTK_BUTTONBOX_START`, `GTK_BUTTONBOX_SPREAD` or `GTK_BUTTONBOX_EDGE`, and before the other children if the style is `GTK_BUTTONBOX_END`. For horizontal button boxes, the definition of before/after depends on direction of the widget (see `gtk_widget_set_direction()`). If the style is `GTK_BUTTONBOX_START` or `GTK_BUTTONBOX_END`, then the secondary children are aligned at the other end of the button box from the main children. For the other styles, they appear immediately next to the main children.

`widget` : | a GtkButtonBox
`child` : | a child of `widget`
`is_secondary` : | if `TRUE`, the `child` appears in a secondary group of the button box.

## Properties

### The "`layout-style`" property

      "layout-style"         GtkButtonBoxStyle     : Read / Write

How to layout the buttons in the box. Possible values are default, spread, edge, start and end.

## Child Properties

### The "`secondary`" child property

      "secondary"            gboolean              : Read / Write

If TRUE, the child appears in a secondary group of children, suitable for, e.g., help buttons.

## Style Properties

### The "`child-internal-pad-x`" style property

      "child-internal-pad-x" gint                  : Read

Amount to increase child's size on either side.

### The "`child-internal-pad-y`" style property

      "child-internal-pad-y" gint                  : Read

Amount to increase child's size on the top and bottom.

### The "`child-min-height`" style property

      "child-min-height"     gint                  : Read

Minimum height of buttons inside the box.

### The "`child-min-width`" style property

      "child-min-width"      gint                  : Read

Minimum width of buttons inside the box.

## See Also

GtkVButtonBox | Vertical sub-class of GtkButtonBox.
GtkHButtonBox | Horizontal sub-class of GtkButtonBox.