Synopsis
#include <gtk/gtk.h>
GtkBox;
GtkBoxChild;
void gtk_box_pack_start (GtkBox *box,
GtkWidget *child,
gboolean expand,
gboolean fill,
guint padding);
void gtk_box_pack_end (GtkBox *box,
GtkWidget *child,
gboolean expand,
gboolean fill,
guint padding);
void gtk_box_pack_start_defaults (GtkBox *box,
GtkWidget *widget);
void gtk_box_pack_end_defaults (GtkBox *box,
GtkWidget *widget);
gboolean gtk_box_get_homogeneous (GtkBox *box);
void gtk_box_set_homogeneous (GtkBox *box,
gboolean homogeneous);
gint gtk_box_get_spacing (GtkBox *box);
void gtk_box_set_spacing (GtkBox *box,
gint spacing);
void gtk_box_reorder_child (GtkBox *box,
GtkWidget *child,
gint position);
void gtk_box_query_child_packing (GtkBox *box,
GtkWidget *child,
gboolean *expand,
gboolean *fill,
guint *padding,
GtkPackType *pack_type);
void gtk_box_set_child_packing (GtkBox *box,
GtkWidget *child,
gboolean expand,
gboolean fill,
guint padding,
GtkPackType pack_type);
Object Hierarchy
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBox
+----GtkButtonBox
+----GtkVBox
+----GtkHBox
Child Properties"expand" gboolean : Read / Write "fill" gboolean : Read / Write "pack-type" GtkPackType : Read / Write "padding" guint : Read / Write "position" gint : Read / Write DescriptionGtkBox is an abstract widget which encapsulates functionality for a particular kind of container, one that organizes a variable number of widgets into a rectangular area. GtkBox has a number of derived classes, e.g. GtkHBox and GtkVBox. The rectangular area of a GtkBox is organized into either a single row or a single column of child widgets depending upon whether the box is of type GtkHBox or GtkVBox, respectively. Thus, all children of a GtkBox are allocated one dimension in common, which is the height of a row, or the width of a column. GtkBox uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a GtkContainer. For a GtkBox, there are two reference positions: the start and the end of the box. For a GtkVBox, the start is defined as the top of the box and the end is defined as the bottom. For a GtkHBox the start is defined as the left side and the end is defined as the right side.
Use repeated calls to
Use
Because GtkBox is a GtkContainer, you may also use
Use
Use
Use
Use DetailsGtkBoxtypedef struct {
GList *GSEAL (children);
gint16 GSEAL (spacing);
guint GSEAL (homogeneous) : 1;
} GtkBox;
The GtkBox describes an instance of GtkBox and contains the following fields. (These fields should be considered read-only. They should never be set by an application.) GtkBoxChildtypedef struct {
GtkWidget *widget;
guint16 padding;
guint expand : 1;
guint fill : 1;
guint pack : 1;
guint is_secondary : 1;
} GtkBoxChild;
The GtkBoxChild holds a child widget of GtkBox and describes
how the child is to be packed into the GtkBox. Use
GtkBoxChild contains the following fields. (These fields should be considered read-only. They should never be directly set by an application.)
gtk_box_pack_start ()void gtk_box_pack_start (GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding);
Adds
gtk_box_pack_end ()void gtk_box_pack_end (GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding);
Adds
gtk_box_pack_start_defaults ()void gtk_box_pack_start_defaults (GtkBox *box, GtkWidget *widget); Warning
Adds
Parameters for how to pack the child
gtk_box_pack_end_defaults ()void gtk_box_pack_end_defaults (GtkBox *box, GtkWidget *widget); Warning
Adds
Parameters for how to pack the child
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 ()void gtk_box_set_homogeneous (GtkBox *box, gboolean homogeneous);
Sets the "homogeneous" property of
gtk_box_get_spacing ()gint gtk_box_get_spacing (GtkBox *box);
Gets the value set by
gtk_box_set_spacing ()void gtk_box_set_spacing (GtkBox *box, gint spacing);
Sets the "spacing" property of
gtk_box_reorder_child ()void gtk_box_reorder_child (GtkBox *box, GtkWidget *child, gint position);
Moves
A widget's position in the
gtk_box_query_child_packing ()void gtk_box_query_child_packing (GtkBox *box, GtkWidget *child, gboolean *expand, gboolean *fill, guint *padding, GtkPackType *pack_type);
Obtains information about how
gtk_box_set_child_packing ()void gtk_box_set_child_packing (GtkBox *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding, GtkPackType pack_type);
Sets the way
Property DetailsThe
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
a derived class that organizes widgets into a row. |
|
a derived class that organizes widgets into a column. |
|
a GtkWidget useful for drawing a border around a GtkBox. |
|
a GtkContainer for organizing widgets into a grid, rather than independent rows or columns. |
|
a GtkContainer for organizing widgets into arbitrary layouts. |