cvs: php-gtk-doc /examples/reference/gtk/gtkliststore append.php constructor.php insert.php set.php /manual/en/reference/gtk gtkenum.xml
gtkliststore.xml
| From: | Christian Weiske | Date: | Wed, 21 Dec 2005 14:34:26 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtkliststore append.php constructor.php insert.php set.php /manual/en/reference/gtk gtkenum.xml gtkliststore.xml |
||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1719@lists.php.net to get a copy of this message | ||
cweiske Wed Dec 21 14:34:26 2005 EDT
Added files:
/php-gtk-doc/examples/reference/gtk/gtkliststore append.php
constructor.php
insert.php set.php
Modified files:
/php-gtk-doc/manual/en/reference/gtk gtkenum.xml gtkliststore.xml
Log:
Began documenenting GtkListStore
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtkenum.xml?r1=1.9&r2=1.10&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtkenum.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.9 php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.10 --- php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.9 Fri Dec 2 21:49:21 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkenum.xml Wed Dec 21 14:34:26 2005 @@ -3893,9 +3893,17 @@ <enum id="gtk.enum.type"> <enumname>GtkType</enumname> <desc> + <para> + GtkType is used in <classname>GtkListStore</classname> and + <classname>GtkTreeStore</classname> to determine the type of + the column in the data table. + </para> <simpara> - - </simpara> + It depends on the GtkType, what type of data may be stored in + the particular column and how the default + <classname>GtkCellRenderer</classname> displays the value in + the view. + </para> </desc> <enumoption> <value>0</value> @@ -3929,14 +3937,14 @@ <value>20</value> <optionname>Gtk::TYPE_BOOLEAN</optionname> <shortdesc> - + A boolean value, <literal>TRUE</literal> or <literal>FALSE</literal> </shortdesc> </enumoption> <enumoption> <value>32</value> <optionname>Gtk::TYPE_LONG</optionname> <shortdesc> - + A big integer number. </shortdesc> </enumoption> <enumoption> @@ -3957,14 +3965,14 @@ <value>60</value> <optionname>Gtk::TYPE_DOUBLE</optionname> <shortdesc> - + A decimal number with a fraction dot in it. </shortdesc> </enumoption> <enumoption> <value>64</value> <optionname>Gtk::TYPE_STRING</optionname> <shortdesc> - + A normal string. </shortdesc> </enumoption> <enumoption> @@ -3999,7 +4007,7 @@ <value>137706104</value> <optionname>Gtk::TYPE_PHP_VALUE</optionname> <shortdesc> - + Any PHP variable content. </shortdesc> </enumoption> </enum> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml:1.2 php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml:1.3 --- php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml:1.2 Tue Aug 2 11:01:45 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml Wed Dec 21 14:34:26 2005 @@ -4,27 +4,104 @@ <classtitle>GtkListStore</classtitle> <classparent>GObject</classparent> <shortdesc> - + Data model for list data. </shortdesc> <desc> - + <para> + The GtkListStore object is a list model for use with a + <classname>GtkTreeView</classname> widget. It can be used + to store any number of tabular data. + </para> + <para> + On <link linked="gtk.gtkliststore.constructor">creation</link>, + you have to determine how many columns the store + will have, and what <link linked="gtk.enum.type">type</link> + they shall be able to contain. + After that, you will fill the model with data by using + the <function class="GtkListStore">set</function>, + <function class="GtkListStore">append</function> or + <function class="GtkListStore">prepend</function> methods. + </para> + <para> + After you have done that, you can use the list store object + as data source for a <classname>GtkTreeView</classname> by + using the <function class="GtkTreeView">set_model</function> + method. + </para> </desc> </classmeta> + + <constructors> + <constructor id="gtk.gtkliststore.constructor"> + <funcsynopsis> + <funcprototype> + <funcdef> <function>GtkListStore</function></funcdef> + <paramdef><enumname>GtkType</enumname> <parameter>type_column_0</parameter></paramdef> + <paramdef><enumname>GtkType</enumname> <parameter><optional>type_column_1</optional></parameter></paramdef> + <paramdef><enumname>GtkType</enumname> <parameter><optional>type_column_2</optional></parameter></paramdef> + <paramdef>...</paramdef> + </funcprototype> + </funcsynopsis> + <shortdesc> + Create a new list store with a number of columns. + </shortdesc> + <desc> + <para> + Create a new list store with a number of columns. For each colum, the + type has to be specified by choosing one of the <enumname>GtkType</enumname>s. + </para> + <example> + <title>Creating and filling a GtkListStore</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/constructor.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + </desc> + </constructor> + </constructors> + + <methods> <method id="gtk.gtkliststore.method.append"> <funcsynopsis> <funcprototype> - <funcdef>void <function>append</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>append</function></funcdef> + <paramdef>array <parameter>items</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Append one row to the end of the list. </shortdesc> <desc> - + <para> + You can use this method if you want to append a complete row + of data at the end of the list store. The <parameter>items</parameter> + has to be of the same size as the number of columns in the store, and + the type of each array entry has to be that of relative model column. + </para> + <para> + The function returns the iterator of the inserted row, which you can + use to refer to it after insertion. + </para> + <example> + <title>Append some rows to a list store</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/append.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkListStore">prepend</function>, + <function class="GtkListStore">insert</function> + </para> </desc> </method> @@ -36,25 +113,51 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Remove all rows. </shortdesc> <desc> - + <simpara> + Removes all data (rows) from the list, leaving it empty. + </simpara> + <para> + See also: + <function class="GtkListStore">remove</function> + </para> </desc> </method> <method id="gtk.gtkliststore.method.insert"> <funcsynopsis> <funcprototype> - <funcdef>void <function>insert</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>insert</function></funcdef> + <paramdef>int <parameter>row</parameter></paramdef> + <paramdef>array <parameter><optional>items</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Insert a row of data at a certain position. </shortdesc> <desc> - + <para> + Inserts a new row at the given position and returns the iterator + for that specific row. After that, you can set the row data via + <function class="GtkListStore">set</function> method. + </para> + <para> + You can pass an array with the complete row data as second parameter, + which automatically sets the data for you. The size of the array has to + match the number of columns in the store, and the type as to be equal + to the corresponding column type. + </para> + <example> + <title>Inserting some rows into a list store</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/insert.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> @@ -182,15 +285,23 @@ <method id="gtk.gtkliststore.method.prepend"> <funcsynopsis> <funcprototype> - <funcdef>void <function>prepend</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>prepend</function></funcdef> + <paramdef>array <parameter>items</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Add a row at the beginning of the list. </shortdesc> <desc> - + <para> + This method works exactly like <function class="GtkListStore">append</function>, + except that the row is inserted at the beginning of the list, not at the end. + </para> + <para> + See also: + <function class="GtkListStore">append</function>, + <function class="GtkListStore">insert</function> + </para> </desc> </method> @@ -198,17 +309,24 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>remove</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Remove a specific row. </shortdesc> <desc> - + <para> + Removes the row specified by the passed iterator. + </para> + <para> + See also: + <function class="GtkListStore">clear</function> + </para> </desc> </method> +<!-- <method id="gtk.gtkliststore.method.reorder"> <funcsynopsis> <funcprototype> @@ -223,19 +341,43 @@ </desc> </method> +--> <method id="gtk.gtkliststore.method.set"> <funcsynopsis> <funcprototype> <funcdef>void <function>set</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef>int <parameter>column_0</parameter></paramdef> + <paramdef>mixed <parameter>value_0</parameter></paramdef> + <paramdef>int <parameter><optional>column_1</optional></parameter></paramdef> + <paramdef>mixed <parameter><optional>value_1</optional></parameter></paramdef> + <paramdef>...</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Change certains columns of a row. </shortdesc> <desc> - + <para> + Change the data of certain columns of the row given by + <parameter>iter</parameter>. + </para> + <para> + The second parameter is the number of the column which data + shall be changed, and the third parameter is the actual data. + You can change more than one column by adding more column + number/data pairs to the method. + </para> + <example> + <title>Inserting some rows into a list store</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/set.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/append.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/append.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/append.php <?php //Create new store with two columns $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); //append one row $store->append(array('Tokio', 34100000)); //append another row $store->append(array('Mexico city', 22650000)); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/constructor.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/constructor.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/constructor.php <?php /* GtkListStore example Here we create a list of the largest cities. For that we need a list store with two columns: The name and the number of inhabitants. The "name" is of type "string", and the number of inhabitants is of type long (big integer). */ $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); /* * Using the "set" method */ //at first, get an iterator for a new row $iterator = $store->append(); //now use that to set the name at that row (column 0) $store->set($iterator, 0, 'Tokio'); //same row: set the inhabitants into column 1 $store->set($iterator, 1, 34100000); //You can set a whole row at once: $iterator = $store->append(); //we add the data "Mexico city" at column 0 and // "22 million" at column 1 at the row $iterator $store->set($iterator, 0, 'Mexico city', 1, 22650000); //Or, even faster: don't even create an iterator variable $store->set($store->append(), 0, 'Seoul', 1, 22250000); /* * Using "append" to add a row without an iterator */ $store->append(array('New York', 21850000)); $store->append(array('São Paulo', 20200000)); /* * And now show what we've got in the store */ function echoRow($store, $path, $iter) { $city = $store->get_value($iter, 0); $number = $store->get_value($iter, 1); echo $city . ' has ' . $number . " inhabitants.\r\n"; } $store->foreach('echoRow'); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/insert.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/insert.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/insert.php <?php //Create new store with two columns $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); //insert the rows at different positions $store->insert(1, array('Tokio', 34100000)); $store->insert(0, array('Mexico city', 22650000)); //use the iterator to set the data after insertion $iter = $store->insert(1); $store->set($iter, 0, 'Seoul', 1, 22250000); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/set.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/set.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/set.php <?php //Create new list store with string and number columns $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); //at first, get an iterator for a new row $iterator = $store->append(); //now use that to set the name at that row (column 0) $store->set($iterator, 0, 'Tokio'); //same row: set the inhabitants into column 1 $store->set($iterator, 1, 34100000); //You can set a whole row at once: $iterator = $store->append(); //we add the data "Mexico city" at column 0 and // "22 million" at column 1 at the row $iterator $store->set($iterator, 0, 'Mexico city', 1, 22650000); //Even faster: don't even create an iterator variable $store->set($store->append(), 0, 'Seoul', 1, 22250000); ?>
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtkenum.xml?r1=1.9&r2=1.10&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtkenum.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.9 php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.10 --- php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.9 Fri Dec 2 21:49:21 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkenum.xml Wed Dec 21 14:34:26 2005 @@ -3893,9 +3893,17 @@ <enum id="gtk.enum.type"> <enumname>GtkType</enumname> <desc> + <para> + GtkType is used in <classname>GtkListStore</classname> and + <classname>GtkTreeStore</classname> to determine the type of + the column in the data table. + </para> <simpara> - - </simpara> + It depends on the GtkType, what type of data may be stored in + the particular column and how the default + <classname>GtkCellRenderer</classname> displays the value in + the view. + </para> </desc> <enumoption> <value>0</value> @@ -3929,14 +3937,14 @@ <value>20</value> <optionname>Gtk::TYPE_BOOLEAN</optionname> <shortdesc> - + A boolean value, <literal>TRUE</literal> or <literal>FALSE</literal> </shortdesc> </enumoption> <enumoption> <value>32</value> <optionname>Gtk::TYPE_LONG</optionname> <shortdesc> - + A big integer number. </shortdesc> </enumoption> <enumoption> @@ -3957,14 +3965,14 @@ <value>60</value> <optionname>Gtk::TYPE_DOUBLE</optionname> <shortdesc> - + A decimal number with a fraction dot in it. </shortdesc> </enumoption> <enumoption> <value>64</value> <optionname>Gtk::TYPE_STRING</optionname> <shortdesc> - + A normal string. </shortdesc> </enumoption> <enumoption> @@ -3999,7 +4007,7 @@ <value>137706104</value> <optionname>Gtk::TYPE_PHP_VALUE</optionname> <shortdesc> - + Any PHP variable content. </shortdesc> </enumoption> </enum> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml:1.2 php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml:1.3 --- php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml:1.2 Tue Aug 2 11:01:45 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkliststore.xml Wed Dec 21 14:34:26 2005 @@ -4,27 +4,104 @@ <classtitle>GtkListStore</classtitle> <classparent>GObject</classparent> <shortdesc> - + Data model for list data. </shortdesc> <desc> - + <para> + The GtkListStore object is a list model for use with a + <classname>GtkTreeView</classname> widget. It can be used + to store any number of tabular data. + </para> + <para> + On <link linked="gtk.gtkliststore.constructor">creation</link>, + you have to determine how many columns the store + will have, and what <link linked="gtk.enum.type">type</link> + they shall be able to contain. + After that, you will fill the model with data by using + the <function class="GtkListStore">set</function>, + <function class="GtkListStore">append</function> or + <function class="GtkListStore">prepend</function> methods. + </para> + <para> + After you have done that, you can use the list store object + as data source for a <classname>GtkTreeView</classname> by + using the <function class="GtkTreeView">set_model</function> + method. + </para> </desc> </classmeta> + + <constructors> + <constructor id="gtk.gtkliststore.constructor"> + <funcsynopsis> + <funcprototype> + <funcdef> <function>GtkListStore</function></funcdef> + <paramdef><enumname>GtkType</enumname> <parameter>type_column_0</parameter></paramdef> + <paramdef><enumname>GtkType</enumname> <parameter><optional>type_column_1</optional></parameter></paramdef> + <paramdef><enumname>GtkType</enumname> <parameter><optional>type_column_2</optional></parameter></paramdef> + <paramdef>...</paramdef> + </funcprototype> + </funcsynopsis> + <shortdesc> + Create a new list store with a number of columns. + </shortdesc> + <desc> + <para> + Create a new list store with a number of columns. For each colum, the + type has to be specified by choosing one of the <enumname>GtkType</enumname>s. + </para> + <example> + <title>Creating and filling a GtkListStore</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/constructor.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + </desc> + </constructor> + </constructors> + + <methods> <method id="gtk.gtkliststore.method.append"> <funcsynopsis> <funcprototype> - <funcdef>void <function>append</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>append</function></funcdef> + <paramdef>array <parameter>items</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Append one row to the end of the list. </shortdesc> <desc> - + <para> + You can use this method if you want to append a complete row + of data at the end of the list store. The <parameter>items</parameter> + has to be of the same size as the number of columns in the store, and + the type of each array entry has to be that of relative model column. + </para> + <para> + The function returns the iterator of the inserted row, which you can + use to refer to it after insertion. + </para> + <example> + <title>Append some rows to a list store</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/append.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkListStore">prepend</function>, + <function class="GtkListStore">insert</function> + </para> </desc> </method> @@ -36,25 +113,51 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Remove all rows. </shortdesc> <desc> - + <simpara> + Removes all data (rows) from the list, leaving it empty. + </simpara> + <para> + See also: + <function class="GtkListStore">remove</function> + </para> </desc> </method> <method id="gtk.gtkliststore.method.insert"> <funcsynopsis> <funcprototype> - <funcdef>void <function>insert</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>insert</function></funcdef> + <paramdef>int <parameter>row</parameter></paramdef> + <paramdef>array <parameter><optional>items</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Insert a row of data at a certain position. </shortdesc> <desc> - + <para> + Inserts a new row at the given position and returns the iterator + for that specific row. After that, you can set the row data via + <function class="GtkListStore">set</function> method. + </para> + <para> + You can pass an array with the complete row data as second parameter, + which automatically sets the data for you. The size of the array has to + match the number of columns in the store, and the type as to be equal + to the corresponding column type. + </para> + <example> + <title>Inserting some rows into a list store</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/insert.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> @@ -182,15 +285,23 @@ <method id="gtk.gtkliststore.method.prepend"> <funcsynopsis> <funcprototype> - <funcdef>void <function>prepend</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>prepend</function></funcdef> + <paramdef>array <parameter>items</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Add a row at the beginning of the list. </shortdesc> <desc> - + <para> + This method works exactly like <function class="GtkListStore">append</function>, + except that the row is inserted at the beginning of the list, not at the end. + </para> + <para> + See also: + <function class="GtkListStore">append</function>, + <function class="GtkListStore">insert</function> + </para> </desc> </method> @@ -198,17 +309,24 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>remove</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Remove a specific row. </shortdesc> <desc> - + <para> + Removes the row specified by the passed iterator. + </para> + <para> + See also: + <function class="GtkListStore">clear</function> + </para> </desc> </method> +<!-- <method id="gtk.gtkliststore.method.reorder"> <funcsynopsis> <funcprototype> @@ -223,19 +341,43 @@ </desc> </method> +--> <method id="gtk.gtkliststore.method.set"> <funcsynopsis> <funcprototype> <funcdef>void <function>set</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef>int <parameter>column_0</parameter></paramdef> + <paramdef>mixed <parameter>value_0</parameter></paramdef> + <paramdef>int <parameter><optional>column_1</optional></parameter></paramdef> + <paramdef>mixed <parameter><optional>value_1</optional></parameter></paramdef> + <paramdef>...</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Change certains columns of a row. </shortdesc> <desc> - + <para> + Change the data of certain columns of the row given by + <parameter>iter</parameter>. + </para> + <para> + The second parameter is the number of the column which data + shall be changed, and the third parameter is the actual data. + You can change more than one column by adding more column + number/data pairs to the method. + </para> + <example> + <title>Inserting some rows into a list store</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtkliststore/set.php" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/append.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/append.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/append.php <?php //Create new store with two columns $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); //append one row $store->append(array('Tokio', 34100000)); //append another row $store->append(array('Mexico city', 22650000)); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/constructor.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/constructor.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/constructor.php <?php /* GtkListStore example Here we create a list of the largest cities. For that we need a list store with two columns: The name and the number of inhabitants. The "name" is of type "string", and the number of inhabitants is of type long (big integer). */ $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); /* * Using the "set" method */ //at first, get an iterator for a new row $iterator = $store->append(); //now use that to set the name at that row (column 0) $store->set($iterator, 0, 'Tokio'); //same row: set the inhabitants into column 1 $store->set($iterator, 1, 34100000); //You can set a whole row at once: $iterator = $store->append(); //we add the data "Mexico city" at column 0 and // "22 million" at column 1 at the row $iterator $store->set($iterator, 0, 'Mexico city', 1, 22650000); //Or, even faster: don't even create an iterator variable $store->set($store->append(), 0, 'Seoul', 1, 22250000); /* * Using "append" to add a row without an iterator */ $store->append(array('New York', 21850000)); $store->append(array('São Paulo', 20200000)); /* * And now show what we've got in the store */ function echoRow($store, $path, $iter) { $city = $store->get_value($iter, 0); $number = $store->get_value($iter, 1); echo $city . ' has ' . $number . " inhabitants.\r\n"; } $store->foreach('echoRow'); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/insert.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/insert.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/insert.php <?php //Create new store with two columns $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); //insert the rows at different positions $store->insert(1, array('Tokio', 34100000)); $store->insert(0, array('Mexico city', 22650000)); //use the iterator to set the data after insertion $iter = $store->insert(1); $store->set($iter, 0, 'Seoul', 1, 22250000); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkliststore/set.php?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtkliststore/set.php +++ php-gtk-doc/examples/reference/gtk/gtkliststore/set.php <?php //Create new list store with string and number columns $store = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG); //at first, get an iterator for a new row $iterator = $store->append(); //now use that to set the name at that row (column 0) $store->set($iterator, 0, 'Tokio'); //same row: set the inhabitants into column 1 $store->set($iterator, 1, 34100000); //You can set a whole row at once: $iterator = $store->append(); //we add the data "Mexico city" at column 0 and // "22 million" at column 1 at the row $iterator $store->set($iterator, 0, 'Mexico city', 1, 22650000); //Even faster: don't even create an iterator variable $store->set($store->append(), 0, 'Seoul', 1, 22250000); ?>