A container that creates a grid of flexible static rectangles that you can
use to position and size widgets.
The table cells are referenced by rows and columns. The top left of the table
is row 0, column 0.
attach
public void attach(Widget child,
int leftAttach,
int rightAttach,
int topAttach,
int bottomAttach)
Attaches a child widget to a position in the table. This is a convenience
function provides the programmer with a means to add children to a table
with identical padding and expansion options.
child
- The widget to add.leftAttach
- The column number to attach the left side of a child widget
to.rightAttach
- The column number to attach the right side of a child widget
to.topAttach
- The row number to attach the top of a child widget to.bottomAttach
- The row number to attach the bottom of a child widget to.
attach
public void attach(Widget child,
int leftAttach,
int rightAttach,
int topAttach,
int bottomAttach,
AttachOptions xOptions,
AttachOptions yOptions,
int xPadding,
int yPadding)
Attaches a child widget to a position in the table
child
- The widget to add.leftAttach
- The column number to attach the left side of a child widget
to.rightAttach
- The column number to attach the right side of a child widget
to.topAttach
- The row number to attach the top of a child widget to.bottomAttach
- 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 value specifying the padding on the left and right
of the widget being added to the table.yPadding
- The amount of padding above and below the child widget.
getColumnSpacing
public int getColumnSpacing(int column)
Gets the amount of space between column column
, and
column column + 1
.
column
- A row in the table, 0 indicates the first row.
getDefaultColumnSpacing
public int getDefaultColumnSpacing()
returns the default spacing between columns. The only way to change this
is to use setColumnSpacings
, which changes the spacing of
all cells, regardless of whether they have been set
independently.
getDefaultRowSpacing
public int getDefaultRowSpacing()
returns the default spacing between rows. The only way to change this is
to use setRowSpacings
, which changes the spacing of
all cells, regardless of whether they have been set
independently.
getHomogeneous
public boolean getHomogeneous()
Returns whether the table cells are all constrained to the same width and
height
- TRUE if the cells are all constrained to the same size
getRowSpacing
public int getRowSpacing(int row)
Gets the amount of space between row row
, and row
row + 1
.
row
- A row in the table, 0 indicates the first row.
getTable
public static Table getTable(Handle handle)
Internal static factory method to be used by Java-Gnome only.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Container
resize
public void resize(int rows,
int columns)
Changes the size of the table after it has been created. The parameters
define the requested total number of rows/columns after the resize.
setColumnSpacing
public void setColumnSpacing(int spacing)
Sets the space between every column in the table. This
overrides any previous changes to particular cells.
spacing
- The number of pixels of space to place between every column in
the table.
setColumnSpacing
public void setColumnSpacing(int column,
int spacing)
Changes the space between a given table column and its surrounding
columns.
column
- Column number whose spacing will be changed.spacing
- Number of pixels that the spacing should take up.
setHomogeneous
public void setHomogeneous(boolean homogeneous)
Changes the homogenous property of table cells (ie whether all cells are
an equal size or not).
homogeneous
- Set to TRUE to ensure all table cells are the same size. Set
to FALSE if this is not your desired behaviour.
setRowSpacing
public void setRowSpacing(int spacing)
Sets the space between every row in the table. This overrides
any previous changes to particular cells.
spacing
- The number of pixels of space to place between every row in
the table.
setRowSpacing
public void setRowSpacing(int row,
int spacing)
Changes the space between a given table row and its surrounding rows.
row
- Row number whose spacing will be changed.spacing
- Number of pixels that the spacing should take up.