| Top |
| CtkWidget * | ctk_box_new () |
| void | ctk_box_pack_start () |
| void | ctk_box_pack_end () |
| gboolean | ctk_box_get_homogeneous () |
| void | ctk_box_set_homogeneous () |
| gint | ctk_box_get_spacing () |
| void | ctk_box_set_spacing () |
| void | ctk_box_reorder_child () |
| void | ctk_box_query_child_packing () |
| void | ctk_box_set_child_packing () |
| CtkBaselinePosition | ctk_box_get_baseline_position () |
| void | ctk_box_set_baseline_position () |
| CtkWidget * | ctk_box_get_center_widget () |
| void | ctk_box_set_center_widget () |
| CtkBaselinePosition | baseline-position | Read / Write |
| gboolean | homogeneous | Read / Write |
| int | spacing | Read / Write |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBox
├── CtkAppChooserWidget
├── CtkButtonBox
├── CtkColorChooserWidget
├── CtkColorSelection
├── CtkFileChooserButton
├── CtkFileChooserWidget
├── CtkFontChooserWidget
├── CtkFontSelection
├── CtkHBox
├── CtkInfoBar
├── CtkRecentChooserWidget
├── CtkShortcutsSection
├── CtkShortcutsGroup
├── CtkShortcutsShortcut
├── CtkStackSwitcher
├── CtkStatusbar
╰── CtkVBox
The CtkBox widget arranges child widgets into a single row or column, depending upon the value of its “orientation” property. Within the other dimension, all children are allocated the same size. Of course, the “halign” and “valign” properties can be used on the children to influence their allocation.
CtkBox uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a CtkContainer. For a CtkBox, there are two reference positions: the start and the end of the box. For a vertical CtkBox, the start is defined as the top of the box and the end is defined as the bottom. For a horizontal CtkBox the start is defined as the left side and the end is defined as the right side.
Use repeated calls to ctk_box_pack_start() to pack widgets into a
CtkBox from start to end. Use ctk_box_pack_end() to add widgets from
end to start. You may intersperse these calls and add widgets from
both ends of the same CtkBox.
Because CtkBox is a CtkContainer, you may also use ctk_container_add()
to insert widgets into the box, and they will be packed with the default
values for expand and fill child properties. Use ctk_container_remove()
to remove widgets from the CtkBox.
Use ctk_box_set_homogeneous() to specify whether or not all children
of the CtkBox are forced to get the same amount of space.
Use ctk_box_set_spacing() to determine how much space will be
minimally placed between all children in the CtkBox. Note that
spacing is added between the children, while
padding added by ctk_box_pack_start() or ctk_box_pack_end() is added
on either side of the widget it belongs to.
Use ctk_box_reorder_child() to move a CtkBox child to a different
place in the box.
Use ctk_box_set_child_packing() to reset the expand,
fill and padding child properties.
Use ctk_box_query_child_packing() to query these fields.
CtkWidget * ctk_box_new (CtkOrientation orientation,gint spacing);
Creates a new CtkBox.
orientation |
the box’s orientation. |
|
spacing |
the number of pixels to place by default between children. |
Since: 3.0
void ctk_box_pack_start (CtkBox *box,CtkWidget *child,gboolean expand,gboolean fill,guint padding);
Adds child
to box
, packed with reference to the start of box
.
The child
is packed after any other child packed with reference
to the start of box
.
box |
a CtkBox |
|
child |
the CtkWidget to be added to |
|
expand |
|
|
fill |
|
|
padding |
extra space in pixels to put between this child and its
neighbors, over and above the global amount specified by
“spacing” property. If |
void ctk_box_pack_end (CtkBox *box,CtkWidget *child,gboolean expand,gboolean fill,guint padding);
Adds child
to box
, packed with reference to the end of box
.
The child
is packed after (away from end of) any other child
packed with reference to the end of box
.
box |
a CtkBox |
|
child |
the CtkWidget to be added to |
|
expand |
|
|
fill |
|
|
padding |
extra space in pixels to put between this child and its
neighbors, over and above the global amount specified by
“spacing” property. If |
gboolean
ctk_box_get_homogeneous (CtkBox *box);
Returns whether the box is homogeneous (all children are the
same size). See ctk_box_set_homogeneous().
void ctk_box_set_homogeneous (CtkBox *box,gboolean homogeneous);
Sets the “homogeneous” property of box
, controlling
whether or not all children of box
are given equal space
in the box.
box |
a CtkBox |
|
homogeneous |
a boolean value, |
gint
ctk_box_get_spacing (CtkBox *box);
Gets the value set by ctk_box_set_spacing().
void ctk_box_set_spacing (CtkBox *box,gint spacing);
Sets the “spacing” property of box
, which is the
number of pixels to place between children of box
.
void ctk_box_reorder_child (CtkBox *box,CtkWidget *child,gint position);
Moves child
to a new position
in the list of box
children.
The list contains widgets packed CTK_PACK_START
as well as widgets packed CTK_PACK_END, in the order that these
widgets were added to box
.
A widget’s position in the box
children list determines where
the widget is packed into box
. A child widget at some position
in the list will be packed just after all other widgets of the
same packing type that appear earlier in the list.
void ctk_box_query_child_packing (CtkBox *box,CtkWidget *child,gboolean *expand,gboolean *fill,guint *padding,CtkPackType *pack_type);
Obtains information about how child
is packed into box
.
box |
a CtkBox |
|
child |
the CtkWidget of the child to query |
|
expand |
pointer to return location for expand child property. |
[out] |
fill |
pointer to return location for fill child property. |
[out] |
padding |
pointer to return location for padding child property. |
[out] |
pack_type |
pointer to return location for pack-type child property. |
[out] |
void ctk_box_set_child_packing (CtkBox *box,CtkWidget *child,gboolean expand,gboolean fill,guint padding,CtkPackType pack_type);
Sets the way child
is packed into box
.
CtkBaselinePosition
ctk_box_get_baseline_position (CtkBox *box);
Gets the value set by ctk_box_set_baseline_position().
Since: 3.10
void ctk_box_set_baseline_position (CtkBox *box,CtkBaselinePosition position);
Sets the baseline position of a 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.
Since: 3.10
CtkWidget *
ctk_box_get_center_widget (CtkBox *box);
Retrieves the center widget of the box.
Since: 3.12
“baseline-position” property“baseline-position” CtkBaselinePosition
The position of the baseline aligned widgets if extra space is available.
Owner: CtkBox
Flags: Read / Write
Default value: CTK_BASELINE_POSITION_CENTER
“homogeneous” property “homogeneous” gboolean
Whether the children should all be the same size.
Owner: CtkBox
Flags: Read / Write
Default value: FALSE