MxTable

MxTable — A multi-child layout container based on rows and columns

Functions

Properties

gint column-count Read
gint column-spacing Read / Write
gint row-count Read
gint row-spacing Read / Write

Types and Values

struct MxTable
struct MxTableClass

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MxWidget
                ╰── MxTable

Implemented Interfaces

MxTable implements ClutterContainer, ClutterScriptable, ClutterAnimatable, AtkImplementorIface, MxStylable and MxFocusable.

Description

MxTable is a mult-child layout container based on a table arrangement with rows and columns. MxTable adds several child properties to its children which control their position and size in the table.

While other layouts (like MxGrid) allow you to achieve table-like effects, MxTable is the only layout which allows you to precisely (and easily) place elements at particular grid coordinates, via mx_table_add_actor().

Figure 10. MxTable, 3 rows by 3 columns

Notice how rectangles have only been placed in a few of the cells inside the table: this would be very difficult to do with any other layout, without having layouts within layouts within layouts...

MxTable, 3 rows by 3 columns

Functions

mx_table_new ()

ClutterActor *
mx_table_new (void);

Create a new MxTable

Returns

a new MxTable


mx_table_set_column_spacing ()

void
mx_table_set_column_spacing (MxTable *table,
                             gint spacing);

Sets the amount of spacing between columns.

Parameters

table

a MxTable

 

spacing

spacing in pixels

 

mx_table_get_column_spacing ()

gint
mx_table_get_column_spacing (MxTable *table);

Gets the amount of spacing between columns.

Parameters

table

a MxTable

 

Returns

the spacing between columns in device units


mx_table_set_row_spacing ()

void
mx_table_set_row_spacing (MxTable *table,
                          gint spacing);

Sets the amount of spacing between rows.

Parameters

table

a MxTable

 

spacing

spacing in pixels

 

mx_table_get_row_spacing ()

gint
mx_table_get_row_spacing (MxTable *table);

Gets the amount of spacing between rows.

Parameters

table

a MxTable

 

Returns

the spacing between rows in device units


mx_table_add_actor ()

void
mx_table_add_actor (MxTable *table,
                    ClutterActor *actor,
                    gint row,
                    gint column);

Add an actor at the specified row and column

Note, column and rows numbers start from zero

Parameters

table

a MxTable

 

actor

the child to insert

 

row

the row to place the child into

 

column

the column to place the child into

 

mx_table_add_actor_with_properties ()

void
mx_table_add_actor_with_properties (MxTable *table,
                                    ClutterActor *actor,
                                    gint row,
                                    gint column,
                                    const gchar *first_property_name,
                                    ...);

Add an actor into at the specified row and column, with additional child properties to set.

Parameters

table

a MxTable

 

actor

the child ClutterActor

 

row

the row to place the child into

 

column

the column to place the child into

 

first_property_name

name of the first property to set

 

...

value for the first property, followed optionally by more name/value pairs terminated with NULL.

 

mx_table_get_row_count ()

gint
mx_table_get_row_count (MxTable *table);

Retrieve the current number rows in the table

Parameters

table

A MxTable

 

Returns

the number of rows


mx_table_get_column_count ()

gint
mx_table_get_column_count (MxTable *table);

Retrieve the current number of columns in table

Parameters

table

A MxTable

 

Returns

the number of columns

Types and Values

struct MxTable

struct MxTable;

The contents of this structure is private and should only be accessed using the provided API.


struct MxTableClass

struct MxTableClass {
  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 “column-count” property

  “column-count”             gint

The number of columns in the table.

Owner: MxTable

Flags: Read

Allowed values: >= 0

Default value: 0


The “column-spacing” property

  “column-spacing”           gint

Spacing between columns.

Owner: MxTable

Flags: Read / Write

Allowed values: >= 0

Default value: 0


The “row-count” property

  “row-count”                gint

The number of rows in the table.

Owner: MxTable

Flags: Read

Allowed values: >= 0

Default value: 0


The “row-spacing” property

  “row-spacing”              gint

Spacing between row.

Owner: MxTable

Flags: Read / Write

Allowed values: >= 0

Default value: 0