gtkmm: Gtk::Table Class Reference

Pack widgets in regular patterns. More...

Inheritance diagram for Gtk::Table:
Collaboration diagram for Gtk::Table:

List of all members.

Public Member Functions

virtual ~Table ()
GtkTable* gobj ()
 Provides access to the underlying C GtkObject.

const GtkTable* gobj () const
 Provides access to the underlying C GtkObject.

 Table (guint n_rows=1, guint n_columns=1, bool homogeneous=false)
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)
void resize (guint rows, guint columns)
void set_row_spacing (guint row, guint spacing)
guint get_row_spacing (guint row) const
 Gets the amount of space between row row, and row row + 1.

void set_col_spacing (guint column, guint spacing)
guint get_col_spacing (guint column) const
 Gets the amount of space between column col, and column col + 1.

void set_row_spacings (guint spacing)
void set_col_spacings (guint spacing)
void set_spacings (guint spacing)
guint get_default_row_spacing ()
 Gets the default row spacing for the table.

guint get_default_col_spacing ()
 Gets the default column spacing for the table.

void set_homogeneous (bool homogeneous=true)
bool get_homogeneous () const
 Returns whether the table cells are all constrained to the same width and height.

void get_size (guint& rows, guint& columns) const
 Returns the number of rows and columns in the table.

Glib::PropertyProxy< guint > property_n_rows ()
 The number of rows in the table.

Glib::PropertyProxy_ReadOnly

< guint > 
property_n_rows () const
 The number of rows in the table.

Glib::PropertyProxy< guint > property_n_columns ()
 The number of columns in the table.

Glib::PropertyProxy_ReadOnly

< guint > 
property_n_columns () const
 The number of columns in the table.

Glib::PropertyProxy< guint > property_column_spacing ()
 The amount of space between two consecutive columns.

Glib::PropertyProxy_ReadOnly

< guint > 
property_column_spacing () const
 The amount of space between two consecutive columns.

Glib::PropertyProxy< guint > property_row_spacing ()
 The amount of space between two consecutive rows.

Glib::PropertyProxy_ReadOnly

< guint > 
property_row_spacing () const
 The amount of space between two consecutive rows.

Glib::PropertyProxy< bool > property_homogeneous ()
 If TRUE, the table cells are all the same width/height.

Glib::PropertyProxy_ReadOnly

< bool > 
property_homogeneous () const
 If TRUE, the table cells are all the same width/height.

Related Functions

(Note that these are not member functions.)

Gtk::Tablewrap (GtkTable* object, bool take_copy=false)
 A Glib::wrap() method for this object.


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:

table1.png
See also:
Gtk::HBox, Gtk::VBox

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 
)
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:
columnA 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:
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:
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:
rowA row in the table, 0 indicates the first row.
Returns:
The row spacing.
void Gtk::Table::get_size ( guint &  rows,
guint &  columns 
) const

Returns the number of rows and columns in the table.

Since gtkmm 2.22:
Parameters:
rowsReturn location for the number of rows, or 0.
columnsReturn location for the number of columns, or 0.
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<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_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_ReadOnly<bool> Gtk::Table::property_homogeneous ( ) const

If TRUE, the table cells are all the same width/height.

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<bool> Gtk::Table::property_homogeneous ( )

If TRUE, the table cells are all the same width/height.

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_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_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_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_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.
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.
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:
objectThe C instance.
take_copyFalse 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:
  • gtkmm/table.h