MxBoxLayout

MxBoxLayout — a layout container arranging children in a single line

Functions

Properties

gboolean enable-animations Read / Write
MxOrientation orientation Read / Write
gboolean scroll-to-focused Read / Write
guint spacing Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MxWidget
                ╰── MxBoxLayout
                    ╰── MxListView

Implemented Interfaces

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

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.

Box layout with horizontal flow

Figure 2. Box layout with vertical flow

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

Box layout with vertical flow

Functions

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.

Parameters

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.

Parameters

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

Parameters

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

Parameters

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.

Parameters

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.

Parameters

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 .

Parameters

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.

Parameters

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.

 

mx_box_layout_set_scroll_to_focused ()

void
mx_box_layout_set_scroll_to_focused (MxBoxLayout *box,
                                     gboolean scroll_to_focused);

Enables or disables automatic scrolling to the focused actor.

Parameters

box

A MxBoxLayout

 

scroll_to_focused

TRUE to enable automatically scrolling to the focused actor

 

Since 1.2


mx_box_layout_get_scroll_to_focused ()

gboolean
mx_box_layout_get_scroll_to_focused (MxBoxLayout *box);

Get the value of the “scroll-to-focused” property.

Parameters

box

A MxBoxLayout

 

Returns

TRUE if automatically scrolling to the focused actor is enabled

Since 1.2

Types and Values

struct MxBoxLayout

struct MxBoxLayout;

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


struct MxBoxLayoutClass

struct MxBoxLayoutClass {
  MxWidgetClass parent_class;

  /* padding for future expansion */
  void (*_padding_0) (void);
  void (*_padding_1) (void);
  void (*_padding_2) (void);
  void (*_padding_3) (void);
  void (*_padding_4) (void);
};

Property Details

The “enable-animations” property

  “enable-animations”        gboolean

Enable animations between certain property and child property changes.

Flags: Read / Write

Default value: FALSE


The “orientation” property

  “orientation”              MxOrientation

Orientation of the layout.

Flags: Read / Write

Default value: MX_ORIENTATION_HORIZONTAL


The “scroll-to-focused” property

  “scroll-to-focused”        gboolean

Automatically scroll to the focused actor.

Flags: Read / Write

Default value: TRUE


The “spacing” property

  “spacing”                  guint

Spacing between children.

Flags: Read / Write

Default value: 0