Top |
Functions
Implemented Interfaces
GtkCenterBox implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkOrientable.
Description
The GtkCenterBox widget arranges three children in a horizontal or vertical arrangement, keeping the middle child centered as well as possible.
To add children to GtkCenterBox, use gtk_center_box_set_start_widget()
,
gtk_center_box_set_center_widget()
and gtk_center_box_set_end_widget()
.
The sizing and positioning of children can be influenced with the align and expand properties of the children.
GtkCenterBox as GtkBuildable
The GtkCenterBox implementation of the GtkBuildable interface supports placing children in the 3 positions by specifying “start”, “center” or “end” as the “type” attribute of a <child> element.
CSS nodes
GtkCenterBox uses a single CSS node with the name “box”,
The first child of the GtkCenterBox will be allocated depending on the text direction, i.e. in left-to-right layouts it will be allocated on the left and in right-to-left layouts on the right.
In vertical orientation, the nodes of the children are arranged from top to bottom.
Functions
gtk_center_box_set_start_widget ()
void gtk_center_box_set_start_widget (GtkCenterBox *self
,GtkWidget *child
);
Sets the start widget. To remove the existing start widget, pass NULL
.
gtk_center_box_set_center_widget ()
void gtk_center_box_set_center_widget (GtkCenterBox *self
,GtkWidget *child
);
Sets the center widget. To remove the existing center widget, pas NULL
.
gtk_center_box_set_end_widget ()
void gtk_center_box_set_end_widget (GtkCenterBox *self
,GtkWidget *child
);
Sets the end widget. To remove the existing end widget, pass NULL
.
gtk_center_box_get_start_widget ()
GtkWidget *
gtk_center_box_get_start_widget (GtkCenterBox *self
);
Gets the start widget, or NULL
if there is none.
gtk_center_box_get_center_widget ()
GtkWidget *
gtk_center_box_get_center_widget (GtkCenterBox *self
);
Gets the center widget, or NULL
if there is none.
gtk_center_box_get_end_widget ()
GtkWidget *
gtk_center_box_get_end_widget (GtkCenterBox *self
);
Gets the end widget, or NULL
if there is none.
gtk_center_box_set_baseline_position ()
void gtk_center_box_set_baseline_position (GtkCenterBox *self
,GtkBaselinePosition position
);
Sets the baseline position of a center box.
This affects only horizontal boxes with at least one baseline
aligned child. If there is more vertical space available than
requested, and the baseline is not allocated by the parent then
position
is used to allocate the baseline wrt. the extra space
available.
gtk_center_box_get_baseline_position ()
GtkBaselinePosition
gtk_center_box_get_baseline_position (GtkCenterBox *self
);
Gets the value set by gtk_center_box_set_baseline_position()
.
Property Details
The “baseline-position”
property
“baseline-position” GtkBaselinePosition
The position of the baseline aligned widgets if extra space is available.
Owner: GtkCenterBox
Flags: Read / Write
Default value: GTK_BASELINE_POSITION_CENTER