GtkWrapBox

GtkWrapBox — A container that wraps its children;

Synopsis

#include <gtk/gtk.h>

                    GtkWrapBox;
GtkWidget *         gtk_wrap_box_new                    (GtkWrapAllocationMode mode,
                                                         GtkWrapBoxSpreading horizontal_spreading,
                                                         GtkWrapBoxSpreading vertical_spreading,
                                                         guint horizontal_spacing,
                                                         guint vertical_spacing);
enum                GtkWrapBoxPacking;
void                gtk_wrap_box_insert_child           (GtkWrapBox *box,
                                                         GtkWidget *widget,
                                                         gint index,
                                                         GtkWrapBoxPacking packing);
void                gtk_wrap_box_reorder_child          (GtkWrapBox *box,
                                                         GtkWidget *widget,
                                                         guint index);
enum                GtkWrapAllocationMode;
void                gtk_wrap_box_set_allocation_mode    (GtkWrapBox *box,
                                                         GtkWrapAllocationMode mode);
GtkWrapAllocationMode  gtk_wrap_box_get_allocation_mode (GtkWrapBox *box);
enum                GtkWrapBoxSpreading;
void                gtk_wrap_box_set_vertical_spreading (GtkWrapBox *box,
                                                         GtkWrapBoxSpreading spreading);
GtkWrapBoxSpreading  gtk_wrap_box_get_vertical_spreading
                                                        (GtkWrapBox *box);
void                gtk_wrap_box_set_horizontal_spreading
                                                        (GtkWrapBox *box,
                                                         GtkWrapBoxSpreading spreading);
GtkWrapBoxSpreading  gtk_wrap_box_get_horizontal_spreading
                                                        (GtkWrapBox *box);
void                gtk_wrap_box_set_vertical_spacing   (GtkWrapBox *box,
                                                         guint spacing);
guint               gtk_wrap_box_get_vertical_spacing   (GtkWrapBox *box);
void                gtk_wrap_box_set_horizontal_spacing (GtkWrapBox *box,
                                                         guint spacing);
guint               gtk_wrap_box_get_horizontal_spacing (GtkWrapBox *box);
void                gtk_wrap_box_set_minimum_line_children
                                                        (GtkWrapBox *box,
                                                         guint n_children);
guint               gtk_wrap_box_get_minimum_line_children
                                                        (GtkWrapBox *box);
void                gtk_wrap_box_set_natural_line_children
                                                        (GtkWrapBox *box,
                                                         guint n_children);
guint               gtk_wrap_box_get_natural_line_children
                                                        (GtkWrapBox *box);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkWrapBox

Implemented Interfaces

GtkWrapBox implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Properties

  "allocation-mode"          GtkWrapAllocationMode  : Read / Write
  "horizontal-spacing"       guint                 : Read / Write
  "horizontal-spreading"     GtkWrapBoxSpreading   : Read / Write
  "minimum-line-children"    guint                 : Read / Write
  "natural-line-children"    guint                 : Read / Write
  "vertical-spacing"         guint                 : Read / Write
  "vertical-spreading"       GtkWrapBoxSpreading   : Read / Write

Child Properties

  "packing"                  GtkWrapBoxPacking     : Read / Write

Description

GtkWrapBox allocates space for an ordered list of children by wrapping them over in the box's orentation.

Details

GtkWrapBox

typedef struct _GtkWrapBox GtkWrapBox;


gtk_wrap_box_new ()

GtkWidget *         gtk_wrap_box_new                    (GtkWrapAllocationMode mode,
                                                         GtkWrapBoxSpreading horizontal_spreading,
                                                         GtkWrapBoxSpreading vertical_spreading,
                                                         guint horizontal_spacing,
                                                         guint vertical_spacing);

Creates an GtkWrapBox.

mode :

The GtkWrapAllocationMode to use

horizontal_spreading :

The horizontal GtkWrapBoxSpreading policy to use

vertical_spreading :

The vertical GtkWrapBoxSpreading policy to use

horizontal_spacing :

The horizontal spacing to add between children

vertical_spacing :

The vertical spacing to add between children

Returns :

A new GtkWrapBox container

enum GtkWrapBoxPacking

typedef enum
{
  GTK_WRAP_BOX_H_EXPAND = 1 << 0,
  GTK_WRAP_BOX_V_EXPAND = 1 << 1
} GtkWrapBoxPacking;

Specifies how widgets will expand vertically and horizontally when placed inside a GtkWrapBox.

GTK_WRAP_BOX_H_EXPAND

Whether the child expands horizontally.

GTK_WRAP_BOX_V_EXPAND

Whether the child expands vertically.

gtk_wrap_box_insert_child ()

void                gtk_wrap_box_insert_child           (GtkWrapBox *box,
                                                         GtkWidget *widget,
                                                         gint index,
                                                         GtkWrapBoxPacking packing);

Adds a child to an GtkWrapBox with its packing options set

box :

And GtkWrapBox

widget :

the child GtkWidget to add

index :

the position in the child list to insert, specify -1 to append to the list.

packing :

The GtkWrapBoxPacking options to use.

gtk_wrap_box_reorder_child ()

void                gtk_wrap_box_reorder_child          (GtkWrapBox *box,
                                                         GtkWidget *widget,
                                                         guint index);

Reorders the child widget in box's list of children.

box :

An GtkWrapBox

widget :

The child to reorder

index :

The new child position

enum GtkWrapAllocationMode

typedef enum {
  GTK_WRAP_ALLOCATE_FREE = 0,
  GTK_WRAP_ALLOCATE_ALIGNED,
  GTK_WRAP_ALLOCATE_HOMOGENEOUS
} GtkWrapAllocationMode;

Describes how an GtkWrapBox positions its children.

GTK_WRAP_ALLOCATE_FREE

Items wrap freely in the box's orientation

GTK_WRAP_ALLOCATE_ALIGNED

Items are aligned into rows and columns

GTK_WRAP_ALLOCATE_HOMOGENEOUS

Items are all allocated the same size

gtk_wrap_box_set_allocation_mode ()

void                gtk_wrap_box_set_allocation_mode    (GtkWrapBox *box,
                                                         GtkWrapAllocationMode mode);

Sets the allocation mode for box's children.

box :

An GtkWrapBox

mode :

The GtkWrapAllocationMode to use.

gtk_wrap_box_get_allocation_mode ()

GtkWrapAllocationMode  gtk_wrap_box_get_allocation_mode (GtkWrapBox *box);

Gets the allocation mode.

box :

An GtkWrapBox

Returns :

The GtkWrapAllocationMode for box.

enum GtkWrapBoxSpreading

typedef enum {
  GTK_WRAP_BOX_SPREAD_START = 0,
  GTK_WRAP_BOX_SPREAD_END,
  GTK_WRAP_BOX_SPREAD_EVEN,
  GTK_WRAP_BOX_SPREAD_EXPAND
} GtkWrapBoxSpreading;

Describes how a GtkWrapBox deals with extra space in a given orientation when allocating children.

GTK_WRAP_BOX_SPREAD_START

Children are allocated no more than their natural size in the given orientation and any extra space is left trailing at the end of each row/column.

GTK_WRAP_BOX_SPREAD_END

Children are allocated no more than their natural size in the given orientation and any extra space skipped at the beginning of each row/column.

GTK_WRAP_BOX_SPREAD_EVEN

Children are allocated no more than their natural size in the given orientation and any extra space is evenly distributed as empty space between children.

GTK_WRAP_BOX_SPREAD_EXPAND

Extra space is given to children which asked to expand in the given orientation (or columns/rows which contain children who asked to expand). If no children asked to expand; extra space is distributed evenly.

gtk_wrap_box_set_vertical_spreading ()

void                gtk_wrap_box_set_vertical_spreading (GtkWrapBox *box,
                                                         GtkWrapBoxSpreading spreading);

Sets the vertical spreading mode for box's children.

box :

An GtkWrapBox

spreading :

The GtkWrapBoxSpreading to use.

gtk_wrap_box_get_vertical_spreading ()

GtkWrapBoxSpreading  gtk_wrap_box_get_vertical_spreading
                                                        (GtkWrapBox *box);

Gets the vertical spreading mode.

box :

An GtkWrapBox

Returns :

The vertical GtkWrapBoxSpreading for box.

gtk_wrap_box_set_horizontal_spreading ()

void                gtk_wrap_box_set_horizontal_spreading
                                                        (GtkWrapBox *box,
                                                         GtkWrapBoxSpreading spreading);

Sets the horizontal spreading mode for box's children.

box :

An GtkWrapBox

spreading :

The GtkWrapBoxSpreading to use.

gtk_wrap_box_get_horizontal_spreading ()

GtkWrapBoxSpreading  gtk_wrap_box_get_horizontal_spreading
                                                        (GtkWrapBox *box);

Gets the horizontal spreading mode.

box :

An GtkWrapBox

Returns :

The horizontal GtkWrapBoxSpreading for box.

gtk_wrap_box_set_vertical_spacing ()

void                gtk_wrap_box_set_vertical_spacing   (GtkWrapBox *box,
                                                         guint spacing);

Sets the vertical space to add between children.

box :

An GtkWrapBox

spacing :

The spacing to use.

gtk_wrap_box_get_vertical_spacing ()

guint               gtk_wrap_box_get_vertical_spacing   (GtkWrapBox *box);

Gets the vertical spacing.

box :

An GtkWrapBox

Returns :

The vertical spacing.

gtk_wrap_box_set_horizontal_spacing ()

void                gtk_wrap_box_set_horizontal_spacing (GtkWrapBox *box,
                                                         guint spacing);

Sets the horizontal space to add between children.

box :

An GtkWrapBox

spacing :

The spacing to use.

gtk_wrap_box_get_horizontal_spacing ()

guint               gtk_wrap_box_get_horizontal_spacing (GtkWrapBox *box);

Gets the horizontal spacing.

box :

An GtkWrapBox

Returns :

The horizontal spacing.

gtk_wrap_box_set_minimum_line_children ()

void                gtk_wrap_box_set_minimum_line_children
                                                        (GtkWrapBox *box,
                                                         guint n_children);

Sets the minimum amount of children to line up in box's orientation before wrapping.

box :

An GtkWrapBox

n_children :

The minimum amount of children per line.

gtk_wrap_box_get_minimum_line_children ()

guint               gtk_wrap_box_get_minimum_line_children
                                                        (GtkWrapBox *box);

Gets the minimum amount of children per line.

box :

An GtkWrapBox

Returns :

The minimum amount of children per line.

gtk_wrap_box_set_natural_line_children ()

void                gtk_wrap_box_set_natural_line_children
                                                        (GtkWrapBox *box,
                                                         guint n_children);

Sets the natural length of items to request and allocate space for in box's orientation.

Setting the natural amount of children per line limits the overall natural size request to be no more than n_children items long in the given orientation.

box :

An GtkWrapBox

n_children :

The natural amount of children per line.

gtk_wrap_box_get_natural_line_children ()

guint               gtk_wrap_box_get_natural_line_children
                                                        (GtkWrapBox *box);

Gets the natural amount of children per line.

box :

An GtkWrapBox

Returns :

The natural amount of children per line.

Property Details

The "allocation-mode" property

  "allocation-mode"          GtkWrapAllocationMode  : Read / Write

The GtkWrapAllocationMode to use.

Default value: GTK_WRAP_ALLOCATE_FREE


The "horizontal-spacing" property

  "horizontal-spacing"       guint                 : Read / Write

The amount of horizontal space between two children.

Allowed values: <= 65535

Default value: 0


The "horizontal-spreading" property

  "horizontal-spreading"     GtkWrapBoxSpreading   : Read / Write

The GtkWrapBoxSpreading to used to define what is done with extra space in a given orientation.

Default value: GTK_WRAP_BOX_SPREAD_START


The "minimum-line-children" property

  "minimum-line-children"    guint                 : Read / Write

The minimum number of children to allocate consecutively in the given orientation.

Note

Setting the minimum children per line ensures that a reasonably small height will be requested for the overall minimum width of the box.

Allowed values: <= 65535

Default value: 0


The "natural-line-children" property

  "natural-line-children"    guint                 : Read / Write

The maximum amount of children to request space for consecutively in the given orientation.

Allowed values: <= 65535

Default value: 0


The "vertical-spacing" property

  "vertical-spacing"         guint                 : Read / Write

The amount of vertical space between two children.

Allowed values: <= 65535

Default value: 0


The "vertical-spreading" property

  "vertical-spreading"       GtkWrapBoxSpreading   : Read / Write

The GtkWrapBoxSpreading to used to define what is done with extra space in a given orientation.

Default value: GTK_WRAP_BOX_SPREAD_START

Child Property Details

The "packing" child property

  "packing"                  GtkWrapBoxPacking     : Read / Write

The GtkWrapBoxPacking options to specify how to pack a child into the box.