Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::Table Class Reference

A GtkTable C++ wrapper class. More...

`#include <inti/gtk/table.h>`

Inheritance diagram for Inti::Gtk::Table:

List of all members.

## Public Member Functions

Constructors

- Table (unsigned int rows, unsigned int columns, bool homogeneous=false)
    Construct new table widget.
- virtual ~Table ()
    Destructor.

Accessors

- GtkTable * gtk_table () const
    Get a pointer to the GtkTable structure.
- GtkTableClass * gtk_table_class () const
    Get a pointer to the GtkTableClass structure.
- operator GtkTable * () const
    Conversion operator; safely converts a Table to a GtkTable pointer.
- unsigned int get_row_spacing (unsigned int row) const
    Gets the amount of space between row row, and row row + 1 (see set_row_spacing()).
- unsigned int get_column_spacing (unsigned int column) const
    Gets the amount of space between column column, and column column + 1 (see set_col_spacing()).
- unsigned int get_default_row_spacing () const
    Gets the default row spacing for the table.
- unsigned int get_default_col_spacing () const
    Gets the default column spacing for the table.
- bool get_homogeneous () const
    Returns whether the table cells are all constrained to the same width and height (see set_homogeneous()).

Methods

- void resize (unsigned int rows, unsigned int columns)
    If you need to change the table's size after it has been created, this method allows you to do so.
- void attach (Widget &child, unsigned int left_attach, unsigned int right_attach, unsigned int top_attach, unsigned int bottom_attach, AttachOptionsField xoptions=EXPAND|FILL, AttachOptionsField yoptions=EXPAND|FILL, unsigned int xpadding=0, unsigned int ypadding=0)
    Adds a widget to a table.
- void set_row_spacing (unsigned int row, unsigned int spacing)
    Changes the space between a given table row and its surrounding rows.
- void set_col_spacing (unsigned int column, unsigned int spacing)
    Alters the amount of space between a given table column and the adjacent columns.
- void set_row_spacings (unsigned int spacing)
    Sets the space between every row in the table equal to spacing.
- void set_col_spacings (unsigned int spacing)
    Sets the space between every column in the table equal to spacing.
- void set_spacings (unsigned int row_spacing, unsigned int col_spacing)
    Sets the space between every row in the table equal to row_spacing and every column in the table equal to col_spacing.
- void set_homogeneous (bool homogeneous)
    Sets whether all cells in the table are of equal size or not.

Property Proxies

- const NRowsPropertyProxy prop_n_rows ()
    The number of rows in the table (unsigned int : Read / Write).
- const NColumnsPropertyProxy prop_n_columns ()
    The number of columns in the table (unsigned int : Read / Write).
- const RowSpacingPropertyProxy prop_row_spacing ()
    The amount of space between two consecutive rows (unsigned int : Read / Write).
- const ColumnSpacingPropertyProxy prop_column_spacing ()
    The amount of space between two consecutive columns (unsigned int : Read / Write).
- const HomogeneousPropertyProxy prop_homogeneous ()
    If true this means the table cells are all the same width/height (bool : Read / Write).

Child Property Proxies

- const LeftAttachPropertyProxy prop_left_attach ()
    The column number to attach the left side of the child to (unsigned int : Read / Write).
- const RightAttachPropertyProxy prop_right_attach ()
    The column number to attach the right side of a child widget to (unsigned int : Read / Write).
- const TopAttachPropertyProxy prop_top_attach ()
    The row number to attach the top of a child widget to (unsigned int : Read / Write).
- const BottomAttachPropertyProxy prop_bottom_attach ()
    The row number to attach the bottom of the child to (unsigned int : Read / Write).
- const XOptionsPropertyProxy prop_x_options ()
    Options specifying the horizontal behaviour of the child (AttachOptions : Read / Write).
- const YOptionsPropertyProxy prop_y_options ()
    Options specifying the vertical behaviour of the child (AttachOptions : Read / Write).
- const XPaddingPropertyProxy prop_x_padding ()
    Extra space to put between the child and its left and right neighbors, in pixels (unsigned int : Read / Write).
- const YPaddingPropertyProxy prop_y_padding ()
    Extra space to put between the child and its upper and lower neighbors, in pixels (unsigned int : Read / Write).

## Protected Member Functions

Constructors

- Table (GtkTable *table, bool reference=false)
    Construct a new Table from an existing GtkTable.

## Detailed Description

A GtkTable C++ wrapper class.

The Table widget allows the programmer to arrange widgets in rows and columns, making it easy to align many widgets next to each other, horizontally and vertically.

The size of a table can be changed with resize(). Widgets can be added to a table using attach(). To alter the space next to a specific row, use set_row_spacing(), and for a column, set_col_spacing(). The gaps between all rows or columns can be changed by calling set_row_spacings() or set_col_spacings() respectively. set_homogeneous() can be used to set whether all cells in the table will resize themselves to the size of the largest widget in the table.

## Constructor & Destructor Documentation

Inti::Gtk::Table::Table | ( | GtkTable * | table,
|  | bool | reference = false
| ) | `[explicit, protected]`

Construct a new Table from an existing GtkTable.

Parameters:

  table | A pointer to a GtkTable.
  reference | Set false if the initial reference count is floating, set true if it's not.

The table can be a newly created GtkTable or an existing GtkTable (see G::Object::Object).

Inti::Gtk::Table::Table | ( | unsigned int | rows,
|  | unsigned int | columns,
|  | bool | homogeneous = false
| ) |

Construct new table widget.

Parameters:

  rows | The number of rows the new table should have.
  columns | The number of columns the new table should have.
  homogeneous | true if all cells should be resized to the size of the largest cell.

An initial size must be given by specifying how many rows and columns the table should have, although this can be changed later with resize(). The rows and columns must both be in the range 0 .. 65535.

## Member Function Documentation

void Inti::Gtk::Table::attach | ( | Widget & | child,
|  | unsigned int | left_attach,
|  | unsigned int | right_attach,
|  | unsigned int | top_attach,
|  | unsigned int | bottom_attach,
|  | AttachOptionsField | xoptions = EXPAND|FILL,
|  | AttachOptionsField | yoptions = EXPAND|FILL,
|  | unsigned int | xpadding = 0,
|  | unsigned int | ypadding = 0
| ) |

Adds a widget to a table.

Parameters:

  child | The widget to add.
  left_attach | The column number to attach the left side of a child widget to.
  right_attach | The column number to attach the right side of a child widget to.
  top_attach | The row number to attach the top of a child widget to.
  bottom_attach | The column number to attach the bottom of a child widget to.
  xoptions | Used to specify the properties of the child widget when the table is resized.
  yoptions | The same as xoptions, except this field determines behaviour of vertical resizing.
  xpadding | An integer specifying the padding on the left and right of the widget being added.
  ypadding | The amount of padding above and below the child widget.

The number of 'cells' that a widget will occupy is specified by left_attach, right_attach, top_attach and bottom_attach. These each represent the leftmost, rightmost, uppermost and lowest column and row numbers of the table. (Columns and rows are indexed from zero).

unsigned int Inti::Gtk::Table::get_column_spacing | ( | unsigned int | column | ) | const

Gets the amount of space between column column, and column column + 1 (see set_col_spacing()).

Parameters:

  column | A column in the table, 0 indicates the first column.

Returns:
  The column spacing.

unsigned int Inti::Gtk::Table::get_default_col_spacing | ( |  | ) | const

Gets the default column spacing for the table.

Returns:
  The default column spacing.

This is the spacing that will be used for newly added columns (see set_col_spacings()).

unsigned int Inti::Gtk::Table::get_default_row_spacing | ( |  | ) | const

Gets the default row spacing for the table.

Returns:
  The default row spacing.

This is the spacing that will be used for newly added rows (see set_row_spacings()).

bool Inti::Gtk::Table::get_homogeneous | ( |  | ) | const

Returns whether the table cells are all constrained to the same width and height (see set_homogeneous()).

Returns:
  true if the cells are all constrained to the same size.

unsigned int Inti::Gtk::Table::get_row_spacing | ( | unsigned int | row | ) | const

Gets the amount of space between row row, and row row + 1 (see set_row_spacing()).

Parameters:

  row | A row in the table, 0 indicates the first row.

Returns:
  The row spacing.

void Inti::Gtk::Table::resize | ( | unsigned int | rows,
|  | unsigned int | columns
| ) |

If you need to change the table's size after it has been created, this method allows you to do so.

Parameters:

  rows | The new number of rows.
  columns | The new number of columns.

void Inti::Gtk::Table::set_col_spacing | ( | unsigned int | column,
|  | unsigned int | spacing
| ) |

Alters the amount of space between a given table column and the adjacent columns.

Parameters:

  column | The column whose spacing should be changed.
  spacing | The number of pixels that the spacing should take up.

void Inti::Gtk::Table::set_col_spacings | ( | unsigned int | spacing | ) |

Sets the space between every column in the table equal to spacing.

Parameters:

  spacing | The number of pixels of space to place between every column in the table.

void Inti::Gtk::Table::set_homogeneous | ( | bool | homogeneous | ) |

Sets whether all cells in the table are of equal size or not.

Parameters:

  homogeneous | Set true to ensure all table cells are the same size.

void Inti::Gtk::Table::set_row_spacing | ( | unsigned int | row,
|  | unsigned int | spacing
| ) |

Changes the space between a given table row and its surrounding rows.

Parameters:

  row | The row number whose spacing will be changed.
  spacing | The number of pixels that the spacing should take up.

void Inti::Gtk::Table::set_row_spacings | ( | unsigned int | spacing | ) |

Sets the space between every row in the table equal to spacing.

Parameters:

  spacing | The number of pixels of space to place between every row in the table.

void Inti::Gtk::Table::set_spacings | ( | unsigned int | row_spacing,
|  | unsigned int | col_spacing
| ) |

Sets the space between every row in the table equal to row_spacing and every column in the table equal to col_spacing.

Parameters:

  row_spacing | The number of pixels of space to place between every row in the table.
  col_spacing | The number of pixels of space to place between every column in the table.

The documentation for this class was generated from the following file:

- gtk/table.h

Main Page - Footer