MxBoxLayout

## MxBoxLayout MxBoxLayout — a layout container arranging children in a single line |

## Synopsis

    struct              MxBoxLayout;
    ClutterActor *      mx_box_layout_new                   (void);
    void                mx_box_layout_set_orientation       (MxBoxLayout *box,
                                                             MxOrientation orientation);
    MxOrientation       mx_box_layout_get_orientation       (MxBoxLayout *box);
    void                mx_box_layout_set_spacing           (MxBoxLayout *box,
                                                             guint spacing);
    guint               mx_box_layout_get_spacing           (MxBoxLayout *box);
    gboolean            mx_box_layout_get_enable_animations (MxBoxLayout *box);
    void                mx_box_layout_set_enable_animations (MxBoxLayout *box,
                                                             gboolean enable_animations);
    void                mx_box_layout_add_actor             (MxBoxLayout *box,
                                                             ClutterActor *actor,
                                                             gint position);
    void                mx_box_layout_add_actor_with_properties
                                                            (MxBoxLayout *box,
                                                             ClutterActor *actor,
                                                             gint position,
                                                             const char *first_property,
                                                             ...);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActor
                   +----MxWidget
                         +----MxBoxLayout
                               +----MxListView

## Implemented Interfaces

MxBoxLayout implements ClutterScriptable, MxStylable, ClutterContainer, MxScrollable and MxFocusable.

## Properties

      "enable-animations"        gboolean              : Read / Write
      "orientation"              MxOrientation         : Read / Write
      "spacing"                  guint                 : Read / Write

## Description

The MxBoxLayout arranges its children along a single line, where each child can be allocated either its preferred size or larger if the expand option is set. If the fill option is set, the actor will be allocated more than its requested size. If the fill option is not set, but the expand option is enabled, then the position of the actor within the available space can be determined by the alignment child property.

Figure 1. Box layout with horizontal flow

The image shows an MxBoxLayout with the "orientation" property set to MX_ORIENTATION_HORIZONTAL.

Figure 2. Box layout with vertical flow

The image shows an MxBoxLayout with the "orientation" property set to MX_ORIENTATION_VERTICAL.

## Details

### struct MxBoxLayout

    struct MxBoxLayout;

The contents of this structure are private and should only be accessed through the public API.

### mx_box_layout_new ()

    ClutterActor *      mx_box_layout_new                   (void);

Create a new MxBoxLayout.

Returns : | a newly allocated MxBoxLayout

### mx_box_layout_set_orientation ()

    void                mx_box_layout_set_orientation       (MxBoxLayout *box,
                                                             MxOrientation orientation);

Set the orientation of the box layout.

`box` : | A MxBoxLayout
`orientation` : | orientation value for the layout

### mx_box_layout_get_orientation ()

    MxOrientation       mx_box_layout_get_orientation       (MxBoxLayout *box);

Get the value of the "orientation" property.

`box` : | A MxBoxLayout
Returns : | the orientation of the layout

### mx_box_layout_set_spacing ()

    void                mx_box_layout_set_spacing           (MxBoxLayout *box,
                                                             guint spacing);

Set the amount of spacing between children in pixels

`box` : | A MxBoxLayout
`spacing` : | the spacing value

### mx_box_layout_get_spacing ()

    guint               mx_box_layout_get_spacing           (MxBoxLayout *box);

Get the spacing between children in pixels

`box` : | A MxBoxLayout
Returns : | the spacing value

### mx_box_layout_get_enable_animations ()

    gboolean            mx_box_layout_get_enable_animations (MxBoxLayout *box);

Get the value of the "enable-animations" property.

`box` : | A MxBoxLayout
Returns : | TRUE if animations enabled

### mx_box_layout_set_enable_animations ()

    void                mx_box_layout_set_enable_animations (MxBoxLayout *box,
                                                             gboolean enable_animations);

Enable animations when certain properties change.

`box` : | A MxBoxLayout
`enable_animations` : | TRUE to enable animations

### mx_box_layout_add_actor ()

    void                mx_box_layout_add_actor             (MxBoxLayout *box,
                                                             ClutterActor *actor,
                                                             gint position);

Inserts `actor` at `position` in `box`.

`box` : | a MxBoxLayout
`actor` : | the ClutterActor actor to add to the box layout
`position` : | the position where to insert the actor

### mx_box_layout_add_actor_with_properties ()

    void                mx_box_layout_add_actor_with_properties
                                                            (MxBoxLayout *box,
                                                             ClutterActor *actor,
                                                             gint position,
                                                             const char *first_property,
                                                             ...);

Inserts `actor` at `position` in the layout `box`. You can set some layout properties on the child at the same time.

If `position` is negative, or is larger than the number of actors in the layout, the new actor is added on to the end of the list.

`box` : | a MxBoxLayout
`actor` : | the ClutterActor actor to add to the box layout
`position` : | the position where to insert the actor
`first_property` : | name of the first property to set
`...` : | value for the first property, followed optionally by more name/value pairs terminated with NULL.

## Property Details

### The `"enable-animations"` property

      "enable-animations"        gboolean              : Read / Write

Enable animations between certain property and child property changes.

Default value: FALSE

### The `"orientation"` property

      "orientation"              MxOrientation         : Read / Write

Orientation of the layout.

Default value: MX_ORIENTATION_HORIZONTAL

### The `"spacing"` property

      "spacing"                  guint                 : Read / Write

Spacing between children.

Default value: 0