<html> <head><title>Gtk-- Reference: Gtk::Table</title></head> <body bgcolor="#F0F0F0" text="#000000" link="#0000FF" vlink="#000077" alink="#FF0000"> <table align=center border=0 cellspacing=10> <tr> <td><a href="class_index.html">Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="name_index.html">Namespace Index</a></td> </table> <h1 align=center>Class Gtk::Table</h1><p> <b> Table Packing Widget</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3AContainer.html">Gtk::Container</a> <br> Derived by: <i>none</i> <p> #include <gtk--/table.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=right><tt><tt>explicit</tt> </tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2902"><tt><font color=blue><b>Table</b></font></tt></a></td><td><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>rows</font></tt>=1, <tt><font color=purple>gint</font></tt> <tt><font color=blue>columns</font></tt>=1, <tt><font color=purple>gint</font></tt> <tt><font color=blue>homogeneous</font></tt>=FALSE)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2903"><tt><font color=blue><b>attach</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a>& <tt><font color=blue>child</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>left_attach</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>right_attach</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>top_attach</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>bottom_attach</font></tt>, <tt><font color=purple>gint</font></tt> <tt><font color=blue>xoptions</font></tt>=(GTK_FILL|GTK_EXPAND), <tt><font color=purple>gint</font></tt> <tt><font color=blue>yoptions</font></tt>=(GTK_FILL|GTK_EXPAND), <tt><font color=purple>guint</font></tt> <tt><font color=blue>xpadding</font></tt>=0, <tt><font color=purple>guint</font></tt> <tt><font color=blue>ypadding</font></tt>=0)</tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3ATable.html#2911">TableList</a>&</tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2912"><tt><font color=blue><b>children</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <a href="Gtk%3A%3ATable.html#2911">TableList</a>&</tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2913"><tt><font color=blue><b>children</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkTable</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2898"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <tt><font color=navy>GtkTable</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2899"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2900"><tt><font color=blue><b>isA</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2904"><tt><font color=blue><b>resize</b></font></tt></a></td><td><tt>(<tt><font color=purple>guint</font></tt> <tt><font color=blue>rows</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>columns</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2907"><tt><font color=blue><b>set_col_spacing</b></font></tt></a></td><td><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>column</font></tt>, <tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2909"><tt><font color=blue><b>set_col_spacings</b></font></tt></a></td><td><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2905"><tt><font color=blue><b>set_homogeneous</b></font></tt></a></td><td><tt>(<tt><font color=purple>bool</font></tt> <tt><font color=blue>homogeneous</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2906"><tt><font color=blue><b>set_row_spacing</b></font></tt></a></td><td><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>row</font></tt>, <tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2908"><tt><font color=blue><b>set_row_spacings</b></font></tt></a></td><td><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2910"><tt><font color=blue><b>set_spacings</b></font></tt></a></td><td><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3ATable.html#2901"><tt><font color=blue><b>~Table</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> <tt><font color=navy><b>Gtk::Table</b></font></tt> 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 <i>(rows+1)</i> lattice points vertically and <i>(columns+1)</i> lattice points horizontally. Lattice points start counting from 0. Lattice points can either be specified to be <tt><tt><font color=blue>homogeneous</font></tt></tt> meaning equally spaced or not <tt><tt><font color=blue>homogeneous</font></tt></tt> meaning each cell should be calculated based on the widgets contained in the row and column. Homogeneous defaults to FALSE. <P> 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. <P> <b>Packing options:</b> <P> There are a number of packing objections that can be specified when adding a widget. With <tt><font color=green>GTK_EXPAND</font></tt>, the lattice is allowed to grow to fill space. With <tt><font color=green>GTK_SHRINK</font></tt>, 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 <tt><font color=green>GTK_FILL</font></tt> declares the widget should grow to fill lattice. If this is not set any extra space is used as padding. The default is <tt><font color=green>GTK_FILL</font></tt> and <tt><font color=green>GTK_EXPAND</font></tt>. <P> The table size is calculated based on the size of the widgets contained within and the restrictions imposed by specified options. <P> Padding and spacing can be use in the table. Padding is added on either side of a widget, while spacing is placed between widgets. <P> The other generic packing widgets are: <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3ABox.html"><tt><font color=navy><b>Box</b></font></tt></a></tt>, <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AHBox.html"><tt><font color=navy><b>HBox</b></font></tt></a></tt>, <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AVBox.html"><tt><font color=navy><b>VBox</b></font></tt></a></tt><br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="2903"><font size=+1><b>Gtk::Table::attach</b></font></a> - Binds a widget to a set of lattice points.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3ATable.html#2903"><tt><font color=blue><b>attach</b></font></tt></a><tt>(<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a>& <tt><font color=blue>child</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>left_attach</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>right_attach</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>top_attach</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>bottom_attach</font></tt>, <tt><font color=purple>gint</font></tt> <tt><font color=blue>xoptions</font></tt>=(GTK_FILL|GTK_EXPAND), <tt><font color=purple>gint</font></tt> <tt><font color=blue>yoptions</font></tt>=(GTK_FILL|GTK_EXPAND), <tt><font color=purple>guint</font></tt> <tt><font color=blue>xpadding</font></tt>=0, <tt><font color=purple>guint</font></tt> <tt><font color=blue>ypadding</font></tt>=0)</tt>;<br><blockquote> 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.</blockquote> <br><br> <a name="2898"><font size=+1><b>Gtk::Table::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkTable</font></tt>*</tt> <a href="Gtk%3A%3ATable.html#2898"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="2900"><font size=+1><b>Gtk::Table::isA</b></font></a> - Returns true if object is this type.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3ATable.html#2900"><tt><font color=blue><b>isA</b></font></tt></a><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;<br><br> <a name="2904"><font size=+1><b>Gtk::Table::resize</b></font></a> - (Gtk 1.1) This function allows for dynamic resizing of a Table.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3ATable.html#2904"><tt><font color=blue><b>resize</b></font></tt></a><tt>(<tt><font color=purple>guint</font></tt> <tt><font color=blue>rows</font></tt>, <tt><font color=purple>guint</font></tt> <tt><font color=blue>columns</font></tt>)</tt>;<br><br> <a name="2909"><font size=+1><b>Gtk::Table::set_col_spacings</b></font></a> - This function sets the number of pixels to a appear between every column of cells. Default is 0 pixels.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3ATable.html#2909"><tt><font color=blue><b>set_col_spacings</b></font></tt></a><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;<br><br> <a name="2906"><font size=+1><b>Gtk::Table::set_row_spacing</b></font></a> - This function sets the number of pixels to appear between one row of cells and the next.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3ATable.html#2906"><tt><font color=blue><b>set_row_spacing</b></font></tt></a><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>row</font></tt>, <tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;<br><blockquote> <tt><font color=blue>row</font></tt> is the lattice row counted without the edges starting from 0. Therefore, row 0 would denote between the first and second row of cells. <i>row</i> has a range from 0 and <i>(rows-2)</i> Default spacing is 0 pixels.</blockquote> <br><br> <a name="2908"><font size=+1><b>Gtk::Table::set_row_spacings</b></font></a> - This function sets the number of pixels to a appear between every row of cells. Default is 0 pixels.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3ATable.html#2908"><tt><font color=blue><b>set_row_spacings</b></font></tt></a><tt>(<tt><font color=purple>gint</font></tt> <tt><font color=blue>spacing</font></tt>)</tt>;<br><br> <hr noshade> </html>