CtkButtonBox

CtkButtonBox — A container for arranging buttons

Functions

Properties

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkBox
                    ╰── CtkButtonBox
                        ├── CtkHButtonBox
                        ╰── CtkVButtonBox

Implemented Interfaces

CtkButtonBox implements AtkImplementorIface, CtkBuildable and CtkOrientable.

Includes

#include <ctk/ctk.h>

Description

A button box should be used to provide a consistent layout of buttons throughout your application. The layout/spacing can be altered by the programmer, or if desired, by the user to alter the “feel” of a program to a small degree.

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

The main purpose of CtkButtonBox is to make sure the children have all the same size. CtkButtonBox gives all children the same size, but it does allow 'outliers' to keep their own larger size.

To exempt individual children from homogeneous sizing regardless of their 'outlier' status, you can set the non-homogeneous child property.

CSS nodes

CtkButtonBox uses a single CSS node with name buttonbox.

Functions

ctk_button_box_new ()

CtkWidget *
ctk_button_box_new (CtkOrientation orientation);

Creates a new CtkButtonBox.

Parameters

orientation

the box's orientation.

 

Returns

a new CtkButtonBox.

Since: 3.0


ctk_button_box_get_layout ()

CtkButtonBoxStyle
ctk_button_box_get_layout (CtkButtonBox *widget);

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

Parameters

widget

a CtkButtonBox

 

Returns

the method used to lay out buttons in widget .


ctk_button_box_get_child_secondary ()

gboolean
ctk_button_box_get_child_secondary (CtkButtonBox *widget,
                                    CtkWidget *child);

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

Parameters

widget

a CtkButtonBox

 

child

a child of widget

 

Returns

whether child should appear in a secondary group of children.

Since: 2.4


ctk_button_box_get_child_non_homogeneous ()

gboolean
ctk_button_box_get_child_non_homogeneous
                               (CtkButtonBox *widget,
                                CtkWidget *child);

Returns whether the child is exempted from homogenous sizing.

Parameters

widget

a CtkButtonBox

 

child

a child of widget

 

Returns

TRUE if the child is not subject to homogenous sizing

Since: 3.2


ctk_button_box_set_layout ()

void
ctk_button_box_set_layout (CtkButtonBox *widget,
                           CtkButtonBoxStyle layout_style);

Changes the way buttons are arranged in their container.

Parameters

widget

a CtkButtonBox

 

layout_style

the new layout style

 

ctk_button_box_set_child_secondary ()

void
ctk_button_box_set_child_secondary (CtkButtonBox *widget,
                                    CtkWidget *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 CTK_BUTTONBOX_START, CTK_BUTTONBOX_SPREAD or CTK_BUTTONBOX_EDGE, and before the other children if the style is CTK_BUTTONBOX_END. For horizontal button boxes, the definition of before/after depends on direction of the widget (see ctk_widget_set_direction()). If the style is CTK_BUTTONBOX_START or CTK_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.

Parameters

widget

a CtkButtonBox

 

child

a child of widget

 

is_secondary

if TRUE, the child appears in a secondary group of the button box.

 

ctk_button_box_set_child_non_homogeneous ()

void
ctk_button_box_set_child_non_homogeneous
                               (CtkButtonBox *widget,
                                CtkWidget *child,
                                gboolean non_homogeneous);

Sets whether the child is exempted from homogeous sizing.

Parameters

widget

a CtkButtonBox

 

child

a child of widget

 

non_homogeneous

the new value

 

Since: 3.2

Types and Values

struct CtkButtonBox

struct CtkButtonBox;

struct CtkButtonBoxClass

struct CtkButtonBoxClass {
  CtkBoxClass parent_class;
};

Members


enum CtkButtonBoxStyle

Used to dictate the style that a CtkButtonBox uses to layout the buttons it contains.

Members

CTK_BUTTONBOX_SPREAD

Buttons are evenly spread across the box.

 

CTK_BUTTONBOX_EDGE

Buttons are placed at the edges of the box.

 

CTK_BUTTONBOX_START

Buttons are grouped towards the start of the box, (on the left for a HBox, or the top for a VBox).

 

CTK_BUTTONBOX_END

Buttons are grouped towards the end of the box, (on the right for a HBox, or the bottom for a VBox).

 

CTK_BUTTONBOX_CENTER

Buttons are centered in the box. Since 2.12.

 

CTK_BUTTONBOX_EXPAND

Buttons expand to fill the box. This entails giving buttons a "linked" appearance, making button sizes homogeneous, and setting spacing to 0 (same as calling ctk_box_set_homogeneous() and ctk_box_set_spacing() manually). Since 3.12.

 

Property Details

The “layout-style” property

  “layout-style”             CtkButtonBoxStyle

How to lay out the buttons in the box. Possible values are: spread, edge, start and end.

Owner: CtkButtonBox

Flags: Read / Write

Default value: CTK_BUTTONBOX_EDGE