Top |
Functions
GtkWidget * | gtk_box_new () |
gboolean | gtk_box_get_homogeneous () |
void | gtk_box_set_homogeneous () |
int | gtk_box_get_spacing () |
void | gtk_box_set_spacing () |
GtkBaselinePosition | gtk_box_get_baseline_position () |
void | gtk_box_set_baseline_position () |
void | gtk_box_append () |
void | gtk_box_prepend () |
void | gtk_box_remove () |
void | gtk_box_insert_child_after () |
void | gtk_box_reorder_child_after () |
Properties
GtkBaselinePosition | baseline-position | Read / Write |
gboolean | homogeneous | Read / Write |
int | spacing | Read / Write |
Object Hierarchy
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkBox ├── GtkShortcutsSection ╰── GtkShortcutsGroup
Implemented Interfaces
GtkBox implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkOrientable.
Description
The GtkBox 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.
Use repeated calls to gtk_box_append()
to pack widgets into a GtkBox
from start to end. Use gtk_box_remove()
to remove widgets from the GtkBox.
gtk_box_insert_child_after()
can be used to add a child at a particular position.
Use gtk_box_set_homogeneous()
to specify whether or not all children
of the GtkBox are forced to get the same amount of space.
Use gtk_box_set_spacing()
to determine how much space will be
minimally placed between all children in the GtkBox. Note that
spacing is added between the children.
Use gtk_box_reorder_child_after()
to move a child to a different
place in the box.
Functions
gtk_box_new ()
GtkWidget * gtk_box_new (GtkOrientation orientation
,int spacing
);
Creates a new GtkBox.
gtk_box_get_homogeneous ()
gboolean
gtk_box_get_homogeneous (GtkBox *box
);
Returns whether the box is homogeneous (all children are the
same size). See gtk_box_set_homogeneous()
.
gtk_box_set_homogeneous ()
void gtk_box_set_homogeneous (GtkBox *box
,gboolean homogeneous
);
Sets the “homogeneous” property of box
, controlling
whether or not all children of box
are given equal space
in the box.
Parameters
box |
a GtkBox |
|
homogeneous |
a boolean value, |
gtk_box_get_spacing ()
int
gtk_box_get_spacing (GtkBox *box
);
Gets the value set by gtk_box_set_spacing()
.
gtk_box_set_spacing ()
void gtk_box_set_spacing (GtkBox *box
,int spacing
);
Sets the “spacing” property of box
, which is the
number of pixels to place between children of box
.
gtk_box_get_baseline_position ()
GtkBaselinePosition
gtk_box_get_baseline_position (GtkBox *box
);
Gets the value set by gtk_box_set_baseline_position()
.
gtk_box_set_baseline_position ()
void gtk_box_set_baseline_position (GtkBox *box
,GtkBaselinePosition 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.
gtk_box_append ()
void gtk_box_append (GtkBox *box
,GtkWidget *child
);
Adds child
as the last child to box
.
gtk_box_prepend ()
void gtk_box_prepend (GtkBox *box
,GtkWidget *child
);
Adds child
as the first child to box
.
gtk_box_remove ()
void gtk_box_remove (GtkBox *box
,GtkWidget *child
);
Removes a child widget from box
, after it has been
added with gtk_box_append()
, gtk_box_prepend()
, or
gtk_box_insert_child_after()
.
gtk_box_insert_child_after ()
void gtk_box_insert_child_after (GtkBox *box
,GtkWidget *child
,GtkWidget *sibling
);
Inserts child
in the position after sibling
in the list
of box
children. If sibling
is NULL
, insert child
at
the first position.
Property Details
The “baseline-position”
property
“baseline-position” GtkBaselinePosition
The position of the baseline aligned widgets if extra space is available.
Owner: GtkBox
Flags: Read / Write
Default value: GTK_BASELINE_POSITION_CENTER
The “homogeneous”
property
“homogeneous” gboolean
Whether the children should all be the same size.
Owner: GtkBox
Flags: Read / Write
Default value: FALSE