Clutter.GridLayout

g Clutter.GridLayout Clutter.GridLayout Clutter.LayoutManager Clutter.LayoutManager Clutter.LayoutManager->Clutter.GridLayout GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Clutter.LayoutManager GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

Clutter.LayoutManager (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

attach (child, left, top, width, height)

attach_next_to (child, sibling, side, width, height)

get_child_at (left, top)

get_column_homogeneous ()

get_column_spacing ()

get_orientation ()

get_row_homogeneous ()

get_row_spacing ()

insert_column (position)

insert_next_to (sibling, side)

insert_row (position)

set_column_homogeneous (homogeneous)

set_column_spacing (spacing)

set_orientation (orientation)

set_row_homogeneous (homogeneous)

set_row_spacing (spacing)

Virtual Methods

Inherited:

Clutter.LayoutManager (9), GObject.Object (7)

Properties

Name

Type

Flags

Short Description

column-homogeneous

bool

r/w

If True, the columns are all the same width

column-spacing

int

r/w

The amount of space between two consecutive columns

orientation

Clutter.Orientation

r/w

The orientation of the layout

row-homogeneous

bool

r/w

If True, the rows are all the same height

row-spacing

int

r/w

The amount of space between two consecutive rows

Signals

Inherited:

Clutter.LayoutManager (1), GObject.Object (1)

Fields

Inherited:

Clutter.LayoutManager (1), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Clutter.LayoutManager

r

Class Details

class Clutter.GridLayout(**kwargs)
Bases:

Clutter.LayoutManager

Abstract:

No

Structure:

Clutter.GridLayoutClass

The Clutter.GridLayout structure contains only private data and should be accessed using the provided API

New in version 1.12.

classmethod new()
Returns:

the new Clutter.GridLayout

Return type:

Clutter.LayoutManager

Creates a new Clutter.GridLayout

attach(child, left, top, width, height)
Parameters:
  • child (Clutter.Actor) – the Clutter.Actor to add

  • left (int) – the column number to attach the left side of child to

  • top (int) – the row number to attach the top side of child to

  • width (int) – the number of columns that child will span

  • height (int) – the number of rows that child will span

Adds a widget to the grid.

The position of child is determined by left and top. The number of ‘cells’ that child will occupy is determined by width and height.

New in version 1.12.

attach_next_to(child, sibling, side, width, height)
Parameters:
  • child (Clutter.Actor) – the actor to add

  • sibling (Clutter.Actor or None) – the child of self that child will be placed next to, or None to place child at the beginning or end

  • side (Clutter.GridPosition) – the side of sibling that child is positioned next to

  • width (int) – the number of columns that child will span

  • height (int) – the number of rows that child will span

Adds a actor to the grid.

The actor is placed next to sibling, on the side determined by side. When sibling is None, the actor is placed in row (for left or right placement) or column 0 (for top or bottom placement), at the end indicated by side.

Attaching widgets labeled [1], [2], [3] with sibling == None and side == Clutter.GridPosition.LEFT yields a layout of ‘3 [2]’[1].

New in version 1.12.

get_child_at(left, top)
Parameters:
  • left (int) – the left edge of the cell

  • top (int) – the top edge of the cell

Returns:

the child at the given position, or None

Return type:

Clutter.Actor

Gets the child of self whose area covers the grid cell whose upper left corner is at left, top.

New in version 1.12.

get_column_homogeneous()
Returns:

whether all columns of self have the same width.

Return type:

bool

Returns whether all columns of self have the same width.

get_column_spacing()
Returns:

the spacing between coluns of self

Return type:

int

Retrieves the spacing set using Clutter.GridLayout.set_column_spacing()

New in version 1.12.

get_orientation()
Returns:

the orientation of the layout

Return type:

Clutter.Orientation

Retrieves the orientation of the self.

New in version 1.12.

get_row_homogeneous()
Returns:

whether all rows of self have the same height.

Return type:

bool

Returns whether all rows of self have the same height.

New in version 1.12.

get_row_spacing()
Returns:

the spacing between rows of self

Return type:

int

Retrieves the spacing set using Clutter.GridLayout.set_row_spacing()

New in version 1.12.

insert_column(position)
Parameters:

position (int) – the position to insert the column at

Inserts a column at the specified position.

Children which are attached at or to the right of this position are moved one column to the right. Children which span across this position are grown to span the new column.

New in version 1.12.

insert_next_to(sibling, side)
Parameters:
  • sibling (Clutter.Actor) – the child of self that the new row or column will be placed next to

  • side (Clutter.GridPosition) – the side of sibling that child is positioned next to

Inserts a row or column at the specified position.

The new row or column is placed next to sibling, on the side determined by side. If side is Clutter.GridPosition.LEFT or Clutter.GridPosition.BOTTOM, a row is inserted. If side is Clutter.GridPosition.LEFT of Clutter.GridPosition.RIGHT, a column is inserted.

New in version 1.12.

insert_row(position)
Parameters:

position (int) – the position to insert the row at

Inserts a row at the specified position.

Children which are attached at or below this position are moved one row down. Children which span across this position are grown to span the new row.

New in version 1.12.

set_column_homogeneous(homogeneous)
Parameters:

homogeneous (bool) – True to make columns homogeneous

Sets whether all columns of self will have the same width.

New in version 1.12.

set_column_spacing(spacing)
Parameters:

spacing (int) – the spacing between columns of the layout, in pixels

Sets the spacing between columns of self

New in version 1.12.

set_orientation(orientation)
Parameters:

orientation (Clutter.Orientation) – the orientation of the Clutter.GridLayout

Sets the orientation of the self.

Clutter.GridLayout uses the orientation as a hint when adding children to the Clutter.Actor using it as a layout manager via Clutter.Actor.add_child(); changing this value will not have any effect on children that are already part of the layout.

New in version 1.12.

set_row_homogeneous(homogeneous)
Parameters:

homogeneous (bool) – True to make rows homogeneous

Sets whether all rows of self will have the same height.

New in version 1.12.

set_row_spacing(spacing)
Parameters:

spacing (int) – the spacing between rows of the layout, in pixels

Sets the spacing between rows of self

New in version 1.12.

Property Details

Clutter.GridLayout.props.column_homogeneous
Name:

column-homogeneous

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether all columns of the layout should have the same width

New in version 1.12.

Clutter.GridLayout.props.column_spacing
Name:

column-spacing

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The amount of space in pixels between two consecutive columns

New in version 1.12.

Clutter.GridLayout.props.orientation
Name:

orientation

Type:

Clutter.Orientation

Default Value:

Clutter.Orientation.HORIZONTAL

Flags:

READABLE, WRITABLE

The orientation of the layout, either horizontal or vertical

New in version 1.12.

Clutter.GridLayout.props.row_homogeneous
Name:

row-homogeneous

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether all rows of the layout should have the same height

New in version 1.12.

Clutter.GridLayout.props.row_spacing
Name:

row-spacing

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The amount of space in pixels between two consecutive rows

New in version 1.12.