Top |
Functions
GtkWidget * | gtk_button_box_new () |
GtkButtonBoxStyle | gtk_button_box_get_layout () |
gboolean | gtk_button_box_get_child_secondary () |
gboolean | gtk_button_box_get_child_non_homogeneous () |
void | gtk_button_box_set_layout () |
void | gtk_button_box_set_child_secondary () |
void | gtk_button_box_set_child_non_homogeneous () |
Style Properties
int | child-internal-pad-x | Read |
int | child-internal-pad-y | Read |
int | child-min-height | Read |
int | child-min-width | Read |
Object Hierarchy
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── GtkButtonBox ├── GtkHButtonBox ╰── GtkVButtonBox
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.
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.
The main purpose of GtkButtonBox is to make sure the children have all the same size. GtkButtonBox 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.
Functions
gtk_button_box_new ()
GtkWidget *
gtk_button_box_new (GtkOrientation orientation
);
Creates a new GtkButtonBox.
Since: 3.0
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.
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.
Since: 2.4
gtk_button_box_get_child_non_homogeneous ()
gboolean gtk_button_box_get_child_non_homogeneous (GtkButtonBox *widget
,GtkWidget *child
);
Returns whether the child is exempted from homogenous sizing.
Since: 3.2
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.
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.
gtk_button_box_set_child_non_homogeneous ()
void gtk_button_box_set_child_non_homogeneous (GtkButtonBox *widget
,GtkWidget *child
,gboolean non_homogeneous
);
Sets whether the child is exempted from homogeous sizing.
Since: 3.2
Types and Values
enum GtkButtonBoxStyle
Used to dictate the style that a GtkButtonBox uses to layout the buttons it contains.
Members
Buttons are evenly spread across the box. |
||
Buttons are placed at the edges of the box. |
||
Buttons are grouped towards the start of the box, (on the left for a HBox, or the top for a VBox). |
||
Buttons are grouped towards the end of the box, (on the right for a HBox, or the bottom for a VBox). |
||
Buttons are centered in the box. Since 2.12. |
||
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 |
Property Details
The “layout-style”
property
“layout-style” GtkButtonBoxStyle
How to lay out the buttons in the box. Possible values are: spread, edge, start and end.
Owner: GtkButtonBox
Flags: Read / Write
Default value: GTK_BUTTONBOX_EDGE
Child Property Details
The “non-homogeneous”
child property
“non-homogeneous” gboolean
If TRUE, the child will not be subject to homogeneous sizing.
Owner: GtkButtonBox
Flags: Read / Write
Default value: FALSE
Style Property Details
The “child-internal-pad-x”
style property
“child-internal-pad-x” int
The amount to increase a child's size on either side.
GtkButtonBox:child-internal-pad-x
has been deprecated since version 3.20 and should not be used in newly-written code.
Use CSS padding instead.
Owner: GtkButtonBox
Flags: Read
Allowed values: >= 0
Default value: 4
The “child-internal-pad-y”
style property
“child-internal-pad-y” int
The amount to increase a child's size on the top and bottom.
GtkButtonBox:child-internal-pad-y
has been deprecated since version 3.20 and should not be used in newly-written code.
Use CSS padding instead.
Owner: GtkButtonBox
Flags: Read
Allowed values: >= 0
Default value: 0
The “child-min-height”
style property
“child-min-height” int
The minimum height of buttons inside the box.
GtkButtonBox:child-min-height
has been deprecated since version 3.20 and should not be used in newly-written code.
Use CSS min-height instead.
Owner: GtkButtonBox
Flags: Read
Allowed values: >= 0
Default value: 27
The “child-min-width”
style property
“child-min-width” int
The minimum width of buttons inside the box.
GtkButtonBox:child-min-width
has been deprecated since version 3.20 and should not be used in newly-written code.
Use CSS min-width instead.
Owner: GtkButtonBox
Flags: Read
Allowed values: >= 0
Default value: 85