Main Page Widgets Namespaces Book

# Gtk::Table Class Reference
[Widgets, Container Widgets]

Inheritance diagram for Gtk::Table:

[legend]

List of all members.

## Detailed Description

Pack widgets in regular patterns.

Gtk::Table is one of the primary ways of grouping widgets together. It consists of a set of lattice points to to which widgets can be attached. There are rows + 1 lattice points vertically and columns + 1 lattice points horizontally. Lattice points start counting from 0. Lattice points can either be specified to be homogeneous, meaning equally spaced, or not homogeneous, meaning each cell should be calculated based on the widgets contained in the row and column. The homogeneous property defaults to false.

Widgets can be attached to the table by specifying the top, bottom, left and right points corresponding to upper, lefthand lattice point and the lower, righthand lattice point which the widget should span. Widgets can either be contained in a cell or may span cells. A number of options control the resizing behavior of widgets contained in the table.

Packing options:
  There are a number of packing options that can be specified when adding a widget. With `Gtk::EXPAND`, the lattice is allowed to grow to fill space. With `Gtk::SHRINK`, the lattice is allowed to shrink when resized. It is also possible to specify the behaviour of the widgets allocation within the table. The flag `Gtk::FILL` declares the widget should grow to fill lattice. If this is not set any extra space is used as padding. The default is `(Gtk::FILL | Gtk::EXPAND)`.

Table sizing:
  The table size is calculated based on the size of the widgets contained within and the restrictions imposed by specified options. Padding and spacing can be used in the table. Padding is added on either side of a widget, while spacing is placed between widgets.

A Table widget looks like this:

See also:
  Gtk::HBox, Gtk::VBox

## Public Types

typedef Table_Helpers::TableList | TableList

## Public Member Functions

void | attach (Widget& child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, AttachOptions xoptions=FILL|EXPAND, AttachOptions yoptions=FILL|EXPAND, guint xpadding=0, guint ypadding=0)
const TableList& | children () const
TableList& | children ()
guint | get_col_spacing (guint column) const
| Gets the amount of space between column col, and column col + 1.
guint | get_default_col_spacing ()
| Gets the default column spacing for the table.
guint | get_default_row_spacing ()
| Gets the default row spacing for the table.
bool | get_homogeneous () const
| Returns whether the table cells are all constrained to the same width and height.
guint | get_row_spacing (guint row) const
| Gets the amount of space between row row, and row row + 1.
const GtkTable* | gobj () const
| Provides access to the underlying C GtkObject.
GtkTable* | gobj ()
| Provides access to the underlying C GtkObject.
Glib::PropertyProxy_ReadOnly <guint> | property_column_spacing () const
| The amount of space between two consecutive columns.
Glib::PropertyProxy<guint> | property_column_spacing ()
| The amount of space between two consecutive columns.
Glib::PropertyProxy_ReadOnly <guint> | property_n_columns () const
| The number of columns in the table.
Glib::PropertyProxy<guint> | property_n_columns ()
| The number of columns in the table.
Glib::PropertyProxy_ReadOnly <guint> | property_n_rows () const
| The number of rows in the table.
Glib::PropertyProxy<guint> | property_n_rows ()
| The number of rows in the table.
Glib::PropertyProxy_ReadOnly <guint> | property_row_spacing () const
| The amount of space between two consecutive rows.
Glib::PropertyProxy<guint> | property_row_spacing ()
| The amount of space between two consecutive rows.
void | resize (guint rows, guint columns)
void | set_col_spacing (guint column, guint spacing)
void | set_col_spacings (guint spacing)
void | set_homogeneous (bool homogeneous=true)
void | set_row_spacing (guint row, guint spacing)
void | set_row_spacings (guint spacing)
void | set_spacings (guint spacing)
| Table (guint n_rows=1, guint n_columns=1, bool homogeneous=false)
virtual | ~Table ()

## Related Functions

(Note that these are not member functions.)
Gtk::Table* | wrap (GtkTable* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Member Typedef Documentation

typedef Table_Helpers::TableList Gtk::Table::TableList

## Constructor & Destructor Documentation

virtual Gtk::Table::~Table | ( |  | ) | `[virtual]`

Gtk::Table::Table | ( | guint | n_rows = `1`,
|  | guint | n_columns = `1`,
|  | bool | homogeneous = `false` |
| ) |  |  | `[explicit]`

## Member Function Documentation

void Gtk::Table::attach | ( | Widget& | child,
|  | guint | left_attach,
|  | guint | right_attach,
|  | guint | top_attach,
|  | guint | bottom_attach,
|  | AttachOptions | xoptions = `FILL|EXPAND`,
|  | AttachOptions | yoptions = `FILL|EXPAND`,
|  | guint | xpadding = `0`,
|  | guint | ypadding = `0` |
| ) |  |  |

const TableList& Gtk::Table::children | ( |  | ) | const

TableList& Gtk::Table::children | ( |  | ) |

guint Gtk::Table::get_col_spacing | ( | guint | column | ) | const

Gets the amount of space between column col, and column col + 1.

See set_col_spacing().

Parameters:

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

Returns:
  The column spacing.

guint Gtk::Table::get_default_col_spacing | ( |  | ) |

Gets the default column spacing for the table.

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

Returns:
  Value: the default column spacing.

guint Gtk::Table::get_default_row_spacing | ( |  | ) |

Gets the default row spacing for the table.

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

Returns:
  Value: the default row spacing.

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

Returns whether the table cells are all constrained to the same width and height.

(See set_homogenous())

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

guint Gtk::Table::get_row_spacing | ( | guint | 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.

const GtkTable* Gtk::Table::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

GtkTable* Gtk::Table::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

Glib::PropertyProxy_ReadOnly<guint> Gtk::Table::property_column_spacing | ( |  | ) | const

The amount of space between two consecutive columns.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::Table::property_column_spacing | ( |  | ) |

The amount of space between two consecutive columns.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<guint> Gtk::Table::property_n_columns | ( |  | ) | const

The number of columns in the table.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::Table::property_n_columns | ( |  | ) |

The number of columns in the table.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<guint> Gtk::Table::property_n_rows | ( |  | ) | const

The number of rows in the table.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::Table::property_n_rows | ( |  | ) |

The number of rows in the table.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<guint> Gtk::Table::property_row_spacing | ( |  | ) | const

The amount of space between two consecutive rows.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::Table::property_row_spacing | ( |  | ) |

The amount of space between two consecutive rows.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::Table::resize | ( | guint | rows,
|  | guint | columns |
| ) |  |  |

void Gtk::Table::set_col_spacing | ( | guint | column,
|  | guint | spacing |
| ) |  |  |

void Gtk::Table::set_col_spacings | ( | guint | spacing | ) |

void Gtk::Table::set_homogeneous | ( | bool | homogeneous = `true` | ) |

void Gtk::Table::set_row_spacing | ( | guint | row,
|  | guint | spacing |
| ) |  |  |

void Gtk::Table::set_row_spacings | ( | guint | spacing | ) |

void Gtk::Table::set_spacings | ( | guint | spacing | ) |

## Friends And Related Function Documentation

Gtk::Table* wrap | ( | GtkTable * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

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

- gtk/gtkmm/table.h