---
name: "Gtk_Table"
section: "3"
platform: "linux"
package: "libgtkmm-dev"
version: "1.0.3-1.1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk_Table"
---

# Gtk\_Table(3)

## NAME - Gtk\_Table

Table Packing Widget

## HEADER REQUIRED

**#include \<gtk--/table.h&gt;\>**

## BASE CLASSES

[Gtk\_Container(3)](/Gtk_Container/3.md)

## DESCRIPTION

Gtk\_Table is one of the primary methods for construction of grouped widgets.  It consists of a set of lattice points to to which widgets can be attached.  There are {} 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. Homogeneous defaults to FALSE.

Widgets can be attached to the table at by specifying the top, bottom, left and right points corresponding to upper, lefthand lattice point and the lower, righthand lattice point with 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 objections 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 and GTK\_EXPAND.*

*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 to allow some dead space between* *widgets* *in the table.  Padding is added on either side of a widget, while* *spacing* *is placed between widgets.*

*The other generic packing widgets are:* *Gtk\_Box, Gtk\_HBox, Gtk\_VBox*

## PROPERTIES

- *children*

  *Type: GList\**\

- *rows*

  *Type: GtkTableRowCol\**\

- *cols*

  *Type: GtkTableRowCol\**\

- *nrows*

  *Type: guint16*\

- *ncols*

  *Type: guint16*\

- *column\_spacing*

  *Type: guint16*\

- *row\_spacing*

  *Type: guint16*\

- *homogeneous*

  *Type: guint:1*\

-

   *.IP*

## PUBLIC MEMBER INDEX

```
Gtk_Table(gint rows=1, gint columns=1, gint homogeneous=FALSE);
Gtk_Table(GtkTable *castitem);
void  attach(const Gtk_Widget &child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, gint xoptions=(GTK_FILL|GTK_EXPAND), gint yoptions=(GTK_FILL|GTK_EXPAND), gint xpadding=0, gint ypadding=0);
  Binds a widget to a set of lattice points.
void  attach(const Gtk_ObjectHandle &child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, gint xoptions=(GTK_FILL|GTK_EXPAND), gint yoptions=(GTK_FILL|GTK_EXPAND), gint xpadding=0, gint ypadding=0);
void  resize(guint rows, guint columns);
void  set_homogeneous(bool homogeneous);
void  attach_defaults(const Gtk_Widget &child, gint left_attach, gint right_attach, gint top_attach, gint bottom_attach);
  (obsolete) use {attach()}
void  set_row_spacing(gint row, gint spacing);
void  set_col_spacing(gint column, gint spacing);
void  set_row_spacings(gint spacing);
void  set_col_spacings(gint spacing);
GtkTable*  gtkobj();
const GtkTable*  gtkobj() const;
static bool  isGtkTable(Gtk_Object *checkcast);
```

## PROTECTED MEMBER INDEX

```
friend  CppClassType;
typedef GtkTable  BaseObjectType;
typedef GtkTableClass  BaseClassType;
virtual void * get_parent_class();
```

## PRIVATE MEMBER INDEX

```
static CppClassType  table_class;
GtkType  get_type();
```

## PUBLIC MEMBER DESCRIPTIONS

- *void Gtk\_Table::***attach** *(const Gtk\_Widget &child, guint left\_attach, guint right\_attach, guint top\_attach, guint bottom\_attach, gint xoptions=(GTK\_FILL\|GTK\_EXPAND), gint yoptions=(GTK\_FILL\|GTK\_EXPAND), gint xpadding=0, gint ypadding=0);*

  *Binds a widget to a set of lattice points. .*\
   *At minumum*  *specification of the lattice points is required.*  *Additionally, the cell options as described above and paddings*

  *may be specified. Default paddings are 0 pixels in both dimensions.*\

- *void Gtk\_Table::***resize** *(guint rows, guint columns);*

  *(Gtk 1.1) This function allows for dynamic resizing of*  *a Table.*\

- *void Gtk\_Table::***attach\_defaults** *(const Gtk\_Widget &child, gint left\_attach, gint right\_attach, gint top\_attach, gint bottom\_attach);*

  *(obsolete) use* **attach***().*\
   *attach\_defaults is now obsolete as we have default arguments* *for* *attach().*\

- *void Gtk\_Table::***set\_row\_spacing** *(gint row, gint spacing);*

  *This function sets the number of pixels to appear* *between one row of cells and the next.* **row** *is the*  *lattice row counted without the edges starting from 0. Therefore,* *row* *0 would denote between the first and second* *row of cells.* **row** *has a range from 0 and* **(rows-2)** *Default spacing is 0 pixels.*\

- *void Gtk\_Table::***set\_col\_spacing** *(gint column, gint spacing);*

  *This function sets the number of pixels to appear* *between one column of cells and the next.* **column** *is the*

  *lattice column counted without the edges starting from 0. Therefore,*

  *column 0 would denote between the first and second* *row of cells.* **column** *has a range from 0 and* **(columns-2)***.* *Default spacing is 0 pixels.*\

- *void Gtk\_Table::***set\_row\_spacings** *(gint spacing);*

  *This function sets the number of pixels to a appear between every* *row of cells. Default is 0 pixels.*\

- *void Gtk\_Table::***set\_col\_spacings** *(gint spacing);*

  *This function sets the number of pixels to a appear between every* *column of cells. Default is 0 pixels.*\

## PROTECTED MEMBER DESCRIPTIONS

## PRIVATE MEMBER DESCRIPTIONS
