GtkWrapBox

GtkWrapBox — A container that wraps its children;

Synopsis

#include <gtk/gtk.h>

                    GtkWrapBox;
GtkWidget *         gtk_wrap_box_new                    (GtkWrapAllocationMode mode,
                                                         GtkWrapBoxSpreading spreading,
                                                         guint horizontal_spacing,
                                                         guint vertical_spacing);
void                gtk_wrap_box_reorder_child          (GtkWrapBox *layout,
                                                         GtkWidget *widget,
                                                         guint index);
enum                GtkWrapAllocationMode;
void                gtk_wrap_box_set_allocation_mode    (GtkWrapBox *layout,
                                                         GtkWrapAllocationMode mode);
GtkWrapAllocationMode  gtk_wrap_box_get_allocation_mode (GtkWrapBox *layout);
enum                GtkWrapBoxSpreading;
void                gtk_wrap_box_set_spreading          (GtkWrapBox *layout,
                                                         GtkWrapBoxSpreading spreading);
void                gtk_wrap_box_set_vertical_spacing   (GtkWrapBox *layout,
                                                         guint spacing);
guint               gtk_wrap_box_get_vertical_spacing   (GtkWrapBox *layout);
void                gtk_wrap_box_set_horizontal_spacing (GtkWrapBox *layout,
                                                         guint spacing);
guint               gtk_wrap_box_get_horizontal_spacing (GtkWrapBox *layout);
void                gtk_wrap_box_set_minimum_line_children
                                                        (GtkWrapBox *layout,
                                                         guint n_children);
guint               gtk_wrap_box_get_minimum_line_children
                                                        (GtkWrapBox *layout);
void                gtk_wrap_box_set_natural_line_children
                                                        (GtkWrapBox *layout,
                                                         guint n_children);
guint               gtk_wrap_box_get_natural_line_children
                                                        (GtkWrapBox *layout);

Object Hierarchy

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

Implemented Interfaces

GtkWrapBox implements AtkImplementorIface, GtkBuildable, GtkSizeRequest and GtkOrientable.

Properties

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

Child Properties

  "horizontal-padding"       guint                 : Read / Write
  "packing"                  GtkWrapBoxPacking     : Read / Write
  "vertical-padding"         guint                 : 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 spreading,
                                                         guint horizontal_spacing,
                                                         guint vertical_spacing);

Creates an GtkWrapBox.

mode :

spreading :

The 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

gtk_wrap_box_reorder_child ()

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

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

layout :

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 *layout,
                                                         GtkWrapAllocationMode mode);

Sets the allocation mode for box's children.

layout :

mode :

The GtkWrapAllocationMode to use.

gtk_wrap_box_get_allocation_mode ()

GtkWrapAllocationMode  gtk_wrap_box_get_allocation_mode (GtkWrapBox *layout);

Gets the allocation mode.

layout :

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 an GtkWrapBox deals with extra space when allocating children.

The box always tries to fit as many children at their natural size in the given orentation as possible with the exception of fitting "minimum-line-children" items into the available size. When the available size is larger than the size needed to fit a given number of children at their natural size then extra space is available to distribute among children. The GtkWrapBoxSpreading option describes what to do with this space.

GTK_WRAP_BOX_SPREAD_START

Children are allocated no more than their natural size in the layout's orientation and any extra space is left trailing at the end of each line.

GTK_WRAP_BOX_SPREAD_END

Children are allocated no more than their natural size in the layout's orientation and any extra space skipped at the beginning of each line.

GTK_WRAP_BOX_SPREAD_EVEN

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

GTK_WRAP_BOX_SPREAD_EXPAND

Items share the extra space evenly (or among children that 'expand' when in GTK_WRAP_ALLOCATE_FREE mode.

gtk_wrap_box_set_spreading ()

void                gtk_wrap_box_set_spreading          (GtkWrapBox *layout,
                                                         GtkWrapBoxSpreading spreading);

Sets the spreading mode for box's children.

layout :

spreading :

The GtkWrapBoxSpreading to use.

gtk_wrap_box_set_vertical_spacing ()

void                gtk_wrap_box_set_vertical_spacing   (GtkWrapBox *layout,
                                                         guint spacing);

Sets the vertical space to add between children.

layout :

spacing :

The spacing to use.

gtk_wrap_box_get_vertical_spacing ()

guint               gtk_wrap_box_get_vertical_spacing   (GtkWrapBox *layout);

Gets the vertical spacing.

layout :

Returns :

The vertical spacing.

gtk_wrap_box_set_horizontal_spacing ()

void                gtk_wrap_box_set_horizontal_spacing (GtkWrapBox *layout,
                                                         guint spacing);

Sets the horizontal space to add between children.

layout :

spacing :

The spacing to use.

gtk_wrap_box_get_horizontal_spacing ()

guint               gtk_wrap_box_get_horizontal_spacing (GtkWrapBox *layout);

Gets the horizontal spacing.

layout :

Returns :

The horizontal spacing.

gtk_wrap_box_set_minimum_line_children ()

void                gtk_wrap_box_set_minimum_line_children
                                                        (GtkWrapBox *layout,
                                                         guint n_children);

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

layout :

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 *layout);

Gets the minimum amount of children per line.

layout :

Returns :

The minimum amount of children per line.

gtk_wrap_box_set_natural_line_children ()

void                gtk_wrap_box_set_natural_line_children
                                                        (GtkWrapBox *layout,
                                                         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.

layout :

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 *layout);

Gets the natural amount of children per line.

layout :

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 "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 "spreading" property

  "spreading"                GtkWrapBoxSpreading   : Read / Write

The GtkWrapBoxSpreading to used to define what is done with extra space.

Default value: GTK_WRAP_BOX_SPREAD_START


The "vertical-spacing" property

  "vertical-spacing"         guint                 : Read / Write

The amount of vertical space between two children.

Allowed values: <= 65535

Default value: 0

Child Property Details

The "horizontal-padding" child property

  "horizontal-padding"       guint                 : Read / Write

Extra space to put between the child and its left and right neighbors, in pixels.

Allowed values: <= 65535

Default value: 0


The "packing" child property

  "packing"                  GtkWrapBoxPacking     : Read / Write

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


The "vertical-padding" child property

  "vertical-padding"         guint                 : Read / Write

Extra space to put between the child and its upper and lower neighbors, in pixels.

Allowed values: <= 65535

Default value: 0