cvs: php-gtk-doc /examples/reference/gtk/gtktable constructor.phpw /manual/en/reference/gtk gtkenum.xml gtktable.xml
| From: | Christian Weiske | Date: | Wed, 23 Nov 2005 09:14:04 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtktable constructor.phpw /manual/en/reference/gtk gtkenum.xml gtktable.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1667@lists.php.net to get a copy of this message | ||
cweiske Wed Nov 23 04:14:04 2005 EDT
Added files:
/php-gtk-doc/examples/reference/gtk/gtktable constructor.phpw
Modified files:
/php-gtk-doc/manual/en/reference/gtk gtkenum.xml gtktable.xml
Log:
- Added GtkTable patch (some things fixed) by Jp
- Added GtkAttachOptions to enums
http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkenum.xml?r1=1.7&r2=1.8&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtkenum.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.7 php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.8 --- php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.7 Sat Nov 19 05:06:48 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkenum.xml Wed Nov 23 04:14:03 2005 @@ -254,6 +254,37 @@ </enum> + <enum id="gtk.enum.attachoptions"> + <enumname>GtkAttachOptions</enumname> + <desc> + <simpara> + </simpara> + </desc> + <enumoption> + <value>1</value> + <optionname>Gtk::EXPAND</optionname> + <shortdesc> + The widget should expand to take up any extra + space in its container that has been allocated. + </shortdesc> + </enumoption> + <enumoption> + <value>2</value> + <optionname>Gtk::SHRINK</optionname> + <shortdesc> + The widget should shrink as and when possible. + </shortdesc> + </enumoption> + <enumoption> + <value>4</value> + <optionname>Gtk::FILL</optionname> + <shortdesc> + The widget should fill the space allocated to it. + </shortdesc> + </enumoption> + </enum> + + <enum id="gtk.enum.buttonaction"> <enumname>GtkButtonAction</enumname> <desc> http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtktable.xml?r1=1.2&r2=1.3&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtktable.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtktable.xml:1.2 php-gtk-doc/manual/en/reference/gtk/gtktable.xml:1.3 --- php-gtk-doc/manual/en/reference/gtk/gtktable.xml:1.2 Tue Aug 2 07:01:45 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtktable.xml Wed Nov 23 04:14:03 2005 @@ -23,10 +23,40 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates a grid for packing widgets in regular patterns. </shortdesc> <desc> - + <para> + The first two parameters in this constructor (<parameter>n_rows</parameter>, + <parameter>n_columns</parameter>) define the size of the table and thus the + number of cells. They are optional, and since the table will pick up the + layout from the information given as its children are attached to it, they + will be overridden automatically if needed. + </para> + <para> + The last parameter (<parameter>homogeneous</parameter>) is also optional, + and relates to the way the table manages the size of it's child widgets. + If changed to true (the default value is <literal>FALSE</literal>) all + children will have the same height and width as the largest child. + </para> + <para> + There are a lot of parameters in the + <function class="GtkTable">attach</function> method - nine in total - + four of which are optional. Basically, if the homogeneous parameter in the + constructor is set to <literal>TRUE</literal>, there is very little point + most of the time in using any of the four optional packing parameters. + These come into their own when the children are not required to take up + the same amount of space. + </para> + <example> + <title>GtkTable usage demonstration</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktable/constructor.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </constructor> @@ -38,22 +68,69 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>attach</function></funcdef> - <paramdef>GtkWidget <parameter>child</parameter></paramdef> + <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> <paramdef>int <parameter>left_attach</parameter></paramdef> <paramdef>int <parameter>right_attach</parameter></paramdef> <paramdef>int <parameter>top_attach</parameter></paramdef> <paramdef>int <parameter>bottom_attach</parameter></paramdef> - <paramdef>GtkAttachOptions <parameter><optional>xoptions = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> - <paramdef>GtkAttachOptions <parameter><optional>yoptions = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> - <paramdef>int <parameter><optional>xpadding = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> - <paramdef>int <parameter><optional>ypadding = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> + <paramdef><enumname>GtkAttachOptions</enumname> <parameter><optional>xoptions = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> + <paramdef><enumname>GtkAttachOptions</enumname> <parameter><optional>yoptions = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> + <paramdef>int <parameter><optional>xpadding = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> + <paramdef>int <parameter><optional>ypadding = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Adds widgets to a GtkTable. </shortdesc> <desc> - + <para> + <function class="GtkTable">attach</function> is the way of adding widgets + to a <classname>GtkTable</classname>. It takes up to nine arguments, but + only five are required. + </para> + <para> + The first argument (<parameter>child</parameter>) refers to the child + widget to be attached. The two following arguments ( + <parameter>left_attach</parameter>, <parameter>right_attach</parameter>) + denote the starting point that the child will be drawn from, at the left + hand side, and the end point that the child will be drawn to, to the + right. These parameters are given in terms of columns, with the start + point being 0. The next two arguments (<parameter>top_attach</parameter>, + <parameter>bottom_attach</parameter>) do the same thing, the only + difference beeing that they relate to rows instead of columns, controlling + the vertical positioning. + </para> + <para> + As with all container widgets, the <classname>GtkTable</classname> itself + takes up no screen space until it contains child widgets. If you attach + only one child with parameters that should set it in the bottom right + corner and set <parameter>homogeneous</parameter> to + <literal>FALSE</literal>, the resulting effect will not be that of a table + with only one entry in the bottom right corner, but of a container with a + single widget in it - regardless of the number of columns and rows + specified in the table's constructor. Child settings always take precedence + in a non-homogeneous table, and so all table attachments are relative to + the other child widgets. This is in line with the behaviour of other + multiple-child capable containers where the child widget can have its own + packing parameters set. + </para> + <para> + The behaviour is very different when a regular grid is in position, which + happens when the <classname>GtkTable</classname> has its + <parameter>homogeneous</parameter> parameter set to <literal>TRUE</literal>. + The table works out the dimensions of the grid from the the largest child + widget's size request, and positions its children accordingly. + </para> + <para> + The final four optional parameters determine the way in which the child + widget will respond to the area available to it (expand, shrink, fill) in + each direction, and the padding between the child and its nearest border, + in each direction. + </para> + <para> + See the <link linked="gtk.gtktable.constructor">constructor</link> entry + for an usage example. + </para> </desc> </method> @@ -69,10 +146,15 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Adds widgets to a GtkTable using default options. </shortdesc> <desc> - + <para> + This method is very similar to <function class="GtkTable">attach</function>, + except that it takes less four parameters. Since those parameters are + optional in <function class="GtkTable">attach</function>, this method + is unnecessary. + </para> </desc> </method> @@ -84,14 +166,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the spacing after a given column. </shortdesc> <desc> <para> + Gets the amount of space between a given table column and the adjacent + columns, in pixels. Note that the column count begins at 0. + </para> + <para> See also: <function class="GtkTable">set_col_spacing</function> </para> - </desc> </method> @@ -103,10 +188,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the default column spacing for the table. </shortdesc> <desc> - + <para> + Gets the default column spacing for the table. This is the spacing that + will be used for newly added columns. + </para> + <para> + See also: <function class="GtkTable">set_col_spacings</function> + </para> </desc> </method> @@ -118,10 +209,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the default row spacing for the table. </shortdesc> <desc> - + <para> + Gets the default row spacing for the table. This is the spacing that + will be used for newly added rows. + </para> + <para> + See also: <function class="GtkTable">set_row_spacings</function> + </para> </desc> </method> @@ -133,10 +230,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Returns the current value of the <parameter>homogeneous</parameter> property. </shortdesc> <desc> <para> + Returns whether the table cells are all constrained to the same width and + height. + </para> + <para> See also: <function class="GtkTable">set_homogeneous</function> </para> @@ -152,14 +253,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the amount of space below a given row. </shortdesc> <desc> <para> - See also: - <function class="GtkTable">set_row_spacing</function> + Gets the default row spacing for the table. This is the spacing that + will be used for newly added rows. + </para> + <para> + See also: <function class="GtkTable">set_row_spacing</function>, + <function class="GtkTable">set_row_spacings</function> </para> - </desc> </method> @@ -172,10 +276,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Changes the size of a GtkTable after its creation. </shortdesc> <desc> - + <para> + If you need to change a table's size after it has been created, this + function allows you to do so. + </para> </desc> </method> @@ -188,14 +295,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between a column and the adjacent columns. </shortdesc> <desc> <para> - See also: + Alters the amount of space between a given table column and the adjacent columns. + </para> + <para> + See also: <function class="GtkTable">get_col_spacing</function> </para> - </desc> </method> @@ -207,10 +316,18 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between every column to the same given value. </shortdesc> <desc> - + <para> + Sets the space between every column in <parameter>table</parameter> + equal to <parameter>spacing</parameter>. + </para> + <para> + See also: + <function class="GtkTable">set_col_spacing</function> + <function class="GtkTable">get_col_spacing</function> + </para> </desc> </method> @@ -222,14 +339,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Changes the homogenous property of table cells. </shortdesc> <desc> <para> - See also: + Changes the homogenous property of table cells, ie. whether all cells are an equal size or not. + </para> + <para> + See also: <function class="GtkTable">get_homogeneous</function> </para> - </desc> </method> @@ -242,14 +361,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between a row and the adjacent rows. </shortdesc> <desc> <para> + Alters the amount of space between a given table row and the adjacent rows. + </para> + <para> See also: <function class="GtkTable">get_row_spacing</function> </para> - </desc> </method> @@ -261,10 +382,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between every row to the same given value. </shortdesc> <desc> - + <para> + Sets the space between every row in <parameter>table</parameter> + equal to <parameter>spacing</parameter>. + </para> </desc> </method> http://cvs.php.net/co.php/php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw?r=1.1&p=1 Index: php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw +++ php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw <?php //Checking for php-gtk if (!class_exists('gtk')) { die('Please load the php-gtk2 module in your php.ini' . "\r\n"); } //Creating the window that will hold our example program $window = new GtkWindow(); //Title of the window $window->set_title("GtkTable usage demonstration"); //Initial placement of the window $window->set_position(Gtk::WIN_POS_CENTER); //Connecting the "destroy" signal $window->connect_simple('destroy', array('gtk', 'main_quit')); //Creating our GtkTable - note that the homogeneous property defaults to false. $table = new GtkTable(3, 3, false); //Let's define the spacing between columns and rows to 10 pixels $table->set_row_spacings(10); $table->set_col_spacings(10); //Adding the table to the window $window->add($table); //Now that we have a table, let's add some widgets to it //Note the different AttachOptions: resize the window to see the effects of each $text = new GtkTextView(); $table->attach($text, 0, 3, 0, 1); $button1 = new GtkButton('Button 1 '); $table->attach($button1, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 3, 3); $button2 = new GtkButton('Button 2 '); $table->attach($button2, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL, 3, 3); $button3 = new GtkButton('Button 3 '); $table->attach($button3, 2, 3, 1, 2, Gtk::FILL, Gtk::EXPAND, 3, 3); //Let's add a label with information. We'll use it to experiment with acessing //widgets in a GtkTable $label = new GtkLabel("Expand this window to see the difference \r\n" . "between the GtkAttachOptions settings."); $table->attach($label, 0, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK); //Adding a button that will change the text in the label $button4 = new GtkButton('Change label text'); //If you recall, we created a 3*3 table, but as we're out of space right now, //this button will be placed on row 4. You can use resize(), but just attaching //the child will cause the table to automatically change it's size $table->attach($button4, 0, 3, 3, 4, Gtk::FILL, Gtk::EXPAND, 3, 3); //Let's connect button4 to a function that changes the text of the label $button4->connect_simple('clicked', 'change_text'); //This function accesses the GtkLabel and changes it's content function change_text() { //Getting a list of the GtkTable's child widgets global $table; $children = $table->get_children(); //Echoing the name of the children to the console foreach($children as $key => $var) { echo $var->get_name()."\n"; } echo "\n"; //Accessing the label's text $current_text = $children['1']->get_text(); //Decide which text to show if (substr($current_text, 0, 6) == "Expand") { $children['1']->set_text("Have a nice day! \r\n"); } else { $children['1']->set_text("Expand this window to see the difference \r\n" . "between the GtkAttachOptions settings."); } } //Make everything in the window visible $window->show_all(); //Main loop Gtk::main(); ?>
http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkenum.xml?r1=1.7&r2=1.8&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtkenum.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.7 php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.8 --- php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.7 Sat Nov 19 05:06:48 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkenum.xml Wed Nov 23 04:14:03 2005 @@ -254,6 +254,37 @@ </enum> + <enum id="gtk.enum.attachoptions"> + <enumname>GtkAttachOptions</enumname> + <desc> + <simpara> + </simpara> + </desc> + <enumoption> + <value>1</value> + <optionname>Gtk::EXPAND</optionname> + <shortdesc> + The widget should expand to take up any extra + space in its container that has been allocated. + </shortdesc> + </enumoption> + <enumoption> + <value>2</value> + <optionname>Gtk::SHRINK</optionname> + <shortdesc> + The widget should shrink as and when possible. + </shortdesc> + </enumoption> + <enumoption> + <value>4</value> + <optionname>Gtk::FILL</optionname> + <shortdesc> + The widget should fill the space allocated to it. + </shortdesc> + </enumoption> + </enum> + + <enum id="gtk.enum.buttonaction"> <enumname>GtkButtonAction</enumname> <desc> http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtktable.xml?r1=1.2&r2=1.3&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtktable.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtktable.xml:1.2 php-gtk-doc/manual/en/reference/gtk/gtktable.xml:1.3 --- php-gtk-doc/manual/en/reference/gtk/gtktable.xml:1.2 Tue Aug 2 07:01:45 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtktable.xml Wed Nov 23 04:14:03 2005 @@ -23,10 +23,40 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates a grid for packing widgets in regular patterns. </shortdesc> <desc> - + <para> + The first two parameters in this constructor (<parameter>n_rows</parameter>, + <parameter>n_columns</parameter>) define the size of the table and thus the + number of cells. They are optional, and since the table will pick up the + layout from the information given as its children are attached to it, they + will be overridden automatically if needed. + </para> + <para> + The last parameter (<parameter>homogeneous</parameter>) is also optional, + and relates to the way the table manages the size of it's child widgets. + If changed to true (the default value is <literal>FALSE</literal>) all + children will have the same height and width as the largest child. + </para> + <para> + There are a lot of parameters in the + <function class="GtkTable">attach</function> method - nine in total - + four of which are optional. Basically, if the homogeneous parameter in the + constructor is set to <literal>TRUE</literal>, there is very little point + most of the time in using any of the four optional packing parameters. + These come into their own when the children are not required to take up + the same amount of space. + </para> + <example> + <title>GtkTable usage demonstration</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktable/constructor.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </constructor> @@ -38,22 +68,69 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>attach</function></funcdef> - <paramdef>GtkWidget <parameter>child</parameter></paramdef> + <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> <paramdef>int <parameter>left_attach</parameter></paramdef> <paramdef>int <parameter>right_attach</parameter></paramdef> <paramdef>int <parameter>top_attach</parameter></paramdef> <paramdef>int <parameter>bottom_attach</parameter></paramdef> - <paramdef>GtkAttachOptions <parameter><optional>xoptions = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> - <paramdef>GtkAttachOptions <parameter><optional>yoptions = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> - <paramdef>int <parameter><optional>xpadding = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> - <paramdef>int <parameter><optional>ypadding = GTK_EXPAND|GTK_FILL</optional></parameter></paramdef> + <paramdef><enumname>GtkAttachOptions</enumname> <parameter><optional>xoptions = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> + <paramdef><enumname>GtkAttachOptions</enumname> <parameter><optional>yoptions = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> + <paramdef>int <parameter><optional>xpadding = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> + <paramdef>int <parameter><optional>ypadding = Gtk::EXPAND|Gtk::FILL</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Adds widgets to a GtkTable. </shortdesc> <desc> - + <para> + <function class="GtkTable">attach</function> is the way of adding widgets + to a <classname>GtkTable</classname>. It takes up to nine arguments, but + only five are required. + </para> + <para> + The first argument (<parameter>child</parameter>) refers to the child + widget to be attached. The two following arguments ( + <parameter>left_attach</parameter>, <parameter>right_attach</parameter>) + denote the starting point that the child will be drawn from, at the left + hand side, and the end point that the child will be drawn to, to the + right. These parameters are given in terms of columns, with the start + point being 0. The next two arguments (<parameter>top_attach</parameter>, + <parameter>bottom_attach</parameter>) do the same thing, the only + difference beeing that they relate to rows instead of columns, controlling + the vertical positioning. + </para> + <para> + As with all container widgets, the <classname>GtkTable</classname> itself + takes up no screen space until it contains child widgets. If you attach + only one child with parameters that should set it in the bottom right + corner and set <parameter>homogeneous</parameter> to + <literal>FALSE</literal>, the resulting effect will not be that of a table + with only one entry in the bottom right corner, but of a container with a + single widget in it - regardless of the number of columns and rows + specified in the table's constructor. Child settings always take precedence + in a non-homogeneous table, and so all table attachments are relative to + the other child widgets. This is in line with the behaviour of other + multiple-child capable containers where the child widget can have its own + packing parameters set. + </para> + <para> + The behaviour is very different when a regular grid is in position, which + happens when the <classname>GtkTable</classname> has its + <parameter>homogeneous</parameter> parameter set to <literal>TRUE</literal>. + The table works out the dimensions of the grid from the the largest child + widget's size request, and positions its children accordingly. + </para> + <para> + The final four optional parameters determine the way in which the child + widget will respond to the area available to it (expand, shrink, fill) in + each direction, and the padding between the child and its nearest border, + in each direction. + </para> + <para> + See the <link linked="gtk.gtktable.constructor">constructor</link> entry + for an usage example. + </para> </desc> </method> @@ -69,10 +146,15 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Adds widgets to a GtkTable using default options. </shortdesc> <desc> - + <para> + This method is very similar to <function class="GtkTable">attach</function>, + except that it takes less four parameters. Since those parameters are + optional in <function class="GtkTable">attach</function>, this method + is unnecessary. + </para> </desc> </method> @@ -84,14 +166,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the spacing after a given column. </shortdesc> <desc> <para> + Gets the amount of space between a given table column and the adjacent + columns, in pixels. Note that the column count begins at 0. + </para> + <para> See also: <function class="GtkTable">set_col_spacing</function> </para> - </desc> </method> @@ -103,10 +188,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the default column spacing for the table. </shortdesc> <desc> - + <para> + Gets the default column spacing for the table. This is the spacing that + will be used for newly added columns. + </para> + <para> + See also: <function class="GtkTable">set_col_spacings</function> + </para> </desc> </method> @@ -118,10 +209,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the default row spacing for the table. </shortdesc> <desc> - + <para> + Gets the default row spacing for the table. This is the spacing that + will be used for newly added rows. + </para> + <para> + See also: <function class="GtkTable">set_row_spacings</function> + </para> </desc> </method> @@ -133,10 +230,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Returns the current value of the <parameter>homogeneous</parameter> property. </shortdesc> <desc> <para> + Returns whether the table cells are all constrained to the same width and + height. + </para> + <para> See also: <function class="GtkTable">set_homogeneous</function> </para> @@ -152,14 +253,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Gets the amount of space below a given row. </shortdesc> <desc> <para> - See also: - <function class="GtkTable">set_row_spacing</function> + Gets the default row spacing for the table. This is the spacing that + will be used for newly added rows. + </para> + <para> + See also: <function class="GtkTable">set_row_spacing</function>, + <function class="GtkTable">set_row_spacings</function> </para> - </desc> </method> @@ -172,10 +276,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Changes the size of a GtkTable after its creation. </shortdesc> <desc> - + <para> + If you need to change a table's size after it has been created, this + function allows you to do so. + </para> </desc> </method> @@ -188,14 +295,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between a column and the adjacent columns. </shortdesc> <desc> <para> - See also: + Alters the amount of space between a given table column and the adjacent columns. + </para> + <para> + See also: <function class="GtkTable">get_col_spacing</function> </para> - </desc> </method> @@ -207,10 +316,18 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between every column to the same given value. </shortdesc> <desc> - + <para> + Sets the space between every column in <parameter>table</parameter> + equal to <parameter>spacing</parameter>. + </para> + <para> + See also: + <function class="GtkTable">set_col_spacing</function> + <function class="GtkTable">get_col_spacing</function> + </para> </desc> </method> @@ -222,14 +339,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Changes the homogenous property of table cells. </shortdesc> <desc> <para> - See also: + Changes the homogenous property of table cells, ie. whether all cells are an equal size or not. + </para> + <para> + See also: <function class="GtkTable">get_homogeneous</function> </para> - </desc> </method> @@ -242,14 +361,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between a row and the adjacent rows. </shortdesc> <desc> <para> + Alters the amount of space between a given table row and the adjacent rows. + </para> + <para> See also: <function class="GtkTable">get_row_spacing</function> </para> - </desc> </method> @@ -261,10 +382,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Sets the space between every row to the same given value. </shortdesc> <desc> - + <para> + Sets the space between every row in <parameter>table</parameter> + equal to <parameter>spacing</parameter>. + </para> </desc> </method> http://cvs.php.net/co.php/php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw?r=1.1&p=1 Index: php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw +++ php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw <?php //Checking for php-gtk if (!class_exists('gtk')) { die('Please load the php-gtk2 module in your php.ini' . "\r\n"); } //Creating the window that will hold our example program $window = new GtkWindow(); //Title of the window $window->set_title("GtkTable usage demonstration"); //Initial placement of the window $window->set_position(Gtk::WIN_POS_CENTER); //Connecting the "destroy" signal $window->connect_simple('destroy', array('gtk', 'main_quit')); //Creating our GtkTable - note that the homogeneous property defaults to false. $table = new GtkTable(3, 3, false); //Let's define the spacing between columns and rows to 10 pixels $table->set_row_spacings(10); $table->set_col_spacings(10); //Adding the table to the window $window->add($table); //Now that we have a table, let's add some widgets to it //Note the different AttachOptions: resize the window to see the effects of each $text = new GtkTextView(); $table->attach($text, 0, 3, 0, 1); $button1 = new GtkButton('Button 1 '); $table->attach($button1, 0, 1, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 3, 3); $button2 = new GtkButton('Button 2 '); $table->attach($button2, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL, 3, 3); $button3 = new GtkButton('Button 3 '); $table->attach($button3, 2, 3, 1, 2, Gtk::FILL, Gtk::EXPAND, 3, 3); //Let's add a label with information. We'll use it to experiment with acessing //widgets in a GtkTable $label = new GtkLabel("Expand this window to see the difference \r\n" . "between the GtkAttachOptions settings."); $table->attach($label, 0, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK); //Adding a button that will change the text in the label $button4 = new GtkButton('Change label text'); //If you recall, we created a 3*3 table, but as we're out of space right now, //this button will be placed on row 4. You can use resize(), but just attaching //the child will cause the table to automatically change it's size $table->attach($button4, 0, 3, 3, 4, Gtk::FILL, Gtk::EXPAND, 3, 3); //Let's connect button4 to a function that changes the text of the label $button4->connect_simple('clicked', 'change_text'); //This function accesses the GtkLabel and changes it's content function change_text() { //Getting a list of the GtkTable's child widgets global $table; $children = $table->get_children(); //Echoing the name of the children to the console foreach($children as $key => $var) { echo $var->get_name()."\n"; } echo "\n"; //Accessing the label's text $current_text = $children['1']->get_text(); //Decide which text to show if (substr($current_text, 0, 6) == "Expand") { $children['1']->set_text("Have a nice day! \r\n"); } else { $children['1']->set_text("Expand this window to see the difference \r\n" . "between the GtkAttachOptions settings."); } } //Make everything in the window visible $window->show_all(); //Main loop Gtk::main(); ?>