Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::Table Class Reference

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

#include <xfc/gtk/table.hh>

Inheritance diagram for Xfc::Gtk::Table:

Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable List of all members.

Public Member Functions

Constructors
Accessors
Methods

Protected Member Functions

Constructors

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.

See also: the Table Widget HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::Table::Table GtkTable *  table,
bool  owns_reference = false
[explicit, protected]
 

Construct a new Table from an existing GtkTable.

Parameters:
table A pointer to a GtkTable.
owns_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).

Xfc::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 Xfc::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 row 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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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 Xfc::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: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3