NbtkTable

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

Synopsis

enum                NbtkTableChildOptions;
                    NbtkTable;
NbtkWidget*         nbtk_table_new                      (void);
void                nbtk_table_set_col_spacing          (NbtkTable *table,
                                                         gint spacing);
void                nbtk_table_set_row_spacing          (NbtkTable *table,
                                                         gint spacing);
gint                nbtk_table_get_col_spacing          (NbtkTable *table);
gint                nbtk_table_get_row_spacing          (NbtkTable *table);
void                nbtk_table_add_actor                (NbtkTable *table,
                                                         ClutterActor *actor,
                                                         gint row,
                                                         gint column);
void                nbtk_table_add_actor_with_properties
                                                        (NbtkTable *table,
                                                         ClutterActor *actor,
                                                         gint row,
                                                         gint column,
                                                         const gchar *first_property_name,
                                                         ...);
gint                nbtk_table_get_row_count            (NbtkTable *table);
gint                nbtk_table_get_column_count         (NbtkTable *table);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkTable

Implemented Interfaces

NbtkTable implements ClutterScriptable, NbtkStylable and ClutterContainer.

Properties

  "col-spacing"              gint                  : Read / Write
  "column-count"             gint                  : Read
  "homogeneous"              gboolean              : Read / Write
  "row-count"                gint                  : Read
  "row-spacing"              gint                  : Read / Write

Description

NbtkTable is a mult-child layout container based on a table arrangement with rows and columns. NbtkTable adds several child properties to it's children that control their position and size in the table.

Details

enum NbtkTableChildOptions

typedef enum
{
  NBTK_KEEP_ASPECT_RATIO = 1 << 0,
  NBTK_X_EXPAND          = 1 << 1,
  NBTK_Y_EXPAND          = 1 << 2,
  NBTK_X_FILL            = 1 << 3,
  NBTK_Y_FILL            = 1 << 4
} NbtkTableChildOptions;

Denotes the child properties an NbtkTable child will have.

NBTK_KEEP_ASPECT_RATIO

whether to respect the widget's aspect ratio

NBTK_X_EXPAND

whether to allocate extra space on the widget's x-axis

NBTK_Y_EXPAND

whether to allocate extra space on the widget's y-axis

NBTK_X_FILL

whether to stretch the child to fill the cell horizontally

NBTK_Y_FILL

whether to stretch the child to fill the cell vertically

NbtkTable

typedef struct _NbtkTable NbtkTable;

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


nbtk_table_new ()

NbtkWidget*         nbtk_table_new                      (void);

Create a new NbtkTable

Returns :

a new NbtkTable

nbtk_table_set_col_spacing ()

void                nbtk_table_set_col_spacing          (NbtkTable *table,
                                                         gint spacing);

Sets the amount of spacing between columns.

table :

a NbtkTable

spacing :

spacing in pixels

nbtk_table_set_row_spacing ()

void                nbtk_table_set_row_spacing          (NbtkTable *table,
                                                         gint spacing);

Sets the amount of spacing between rows.

table :

a NbtkTable

spacing :

spacing in pixels

nbtk_table_get_col_spacing ()

gint                nbtk_table_get_col_spacing          (NbtkTable *table);

Gets the amount of spacing between columns.

table :

a NbtkTable

Returns :

the spacing between columns in device units

nbtk_table_get_row_spacing ()

gint                nbtk_table_get_row_spacing          (NbtkTable *table);

Gets the amount of spacing between rows.

table :

a NbtkTable

Returns :

the spacing between rows in device units

nbtk_table_add_actor ()

void                nbtk_table_add_actor                (NbtkTable *table,
                                                         ClutterActor *actor,
                                                         gint row,
                                                         gint column);

Add an actor at the specified row and column

Note, column and rows numbers start from zero

table :

a NbtkTable

actor :

the child to insert

row :

the row to place the child into

column :

the column to place the child into

nbtk_table_add_actor_with_properties ()

void                nbtk_table_add_actor_with_properties
                                                        (NbtkTable *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.

table :

a NbtkTable

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.

nbtk_table_get_row_count ()

gint                nbtk_table_get_row_count            (NbtkTable *table);

Retrieve the current number rows in the table

table :

A NbtkTable

Returns :

the number of rows

nbtk_table_get_column_count ()

gint                nbtk_table_get_column_count         (NbtkTable *table);

Retrieve the current number of columns in table

table :

A NbtkTable

Returns :

the number of columns

Property Details

The "col-spacing" property

  "col-spacing"              gint                  : Read / Write

Spacing between columns.

Allowed values: >= 0

Default value: 0


The "column-count" property

  "column-count"             gint                  : Read

The number of columns in the table.

Allowed values: >= 0

Default value: 0


The "homogeneous" property

  "homogeneous"              gboolean              : Read / Write

Homogeneous rows and columns.

Default value: TRUE


The "row-count" property

  "row-count"                gint                  : Read

The number of rows in the table.

Allowed values: >= 0

Default value: 0


The "row-spacing" property

  "row-spacing"              gint                  : Read / Write

Spacing between row.

Allowed values: >= 0

Default value: 0