cvs: php-gtk-doc /examples/reference/gtk/gtktreestore iter_depth.phpw iter_is_valid.phpw move_after.phpw set.phpw /manual/en/reference/gtk
gtktreestore.xml
| From: | Christian Weiske | Date: | Wed, 18 Jan 2006 18:51:41 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtktreestore iter_depth.phpw iter_is_valid.phpw move_after.phpw set.phpw /manual/en/reference/gtk gtktreestore.xml |
||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1768@lists.php.net to get a copy of this message | ||
cweiske Wed Jan 18 18:51:41 2006 UTC
Added files:
/php-gtk-doc/examples/reference/gtk/gtktreestore iter_depth.phpw
iter_is_valid.phpw
set.phpw
move_after.phpw
Modified files:
/php-gtk-doc/manual/en/reference/gtk gtktreestore.xml
Log:
Completed GtkTreeStore docs
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml?r1=1.4&r2=1.5&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.4 php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.5 --- php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.4 Wed Jan 18 11:36:48 2006 +++ php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml Wed Jan 18 18:51:41 2006 @@ -292,14 +292,27 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>iter_depth</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + How deep an iterator is nested in the tree. </shortdesc> <desc> - + <para> + Calculates how deep the given <parameter>iter</parameter> is nested in + the store. If the given iter is a top-level row, <literal>0</literal> + is returned. + </para> + <example> + <title>Using iter_depth to determine the depth of a row</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/iter_depth.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> @@ -307,14 +320,30 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>iter_is_valid</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + If a given row exists in the store. </shortdesc> <desc> - + <para> + Returns <literal>true</literal> if the given iterator points to a row + that exists in the model. + </para> + <para> + An iterator can get unvalid by removing it (or one of its parents) + from the tree. + </para> + <example> + <title>Checking an iter's validity by using iter_is_valid()</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/iter_is_valid.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> @@ -322,18 +351,37 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>move_after</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Moves a given iter directly after another one. </shortdesc> <desc> <para> + Moves the row given by <parameter>iter</parameter> directly after + <parameter>position</parameter>. + </para> + <para> + That method works only with unsorted stores and requires both iters to + be at the same level. If <parameter>position</parameter> is + <literal>NULL</literal>, the row will be moved to the start + of the level. + </para> + <example> + <title>Moving rows</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/move_after.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> See also: - <function class="GtkTreeStore">insert_after</function> + <function class="GtkTreeStore">move_before</function> </para> - </desc> </method> @@ -341,33 +389,70 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>move_before</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Moves a given iter directly before another one. </shortdesc> <desc> <para> + Moves the row given by <parameter>iter</parameter> directly before + <parameter>position</parameter>. + </para> + <para> + That method works only with unsorted stores and requires both iters to + be at the same level. If <parameter>position</parameter> is + <literal>NULL</literal>, the row will be moved to the end + of the level. + </para> + <para> See also: - <function class="GtkTreeStore">insert_before</function> + <function class="GtkTreeStore">move_before</function> </para> - </desc> </method> <method id="gtk.gtktreestore.method.prepend"> <funcsynopsis> <funcprototype> - <funcdef>void <function>prepend</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>prepend</function></funcdef> + <paramdef><classname>GtkTreeIter</classname> <parameter><optional>parent</optional></parameter></paramdef> + <paramdef>array <parameter>items</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Add a row to the beginning of the store. </shortdesc> <desc> - + <para> + Creates a new line and inserts it at the beginning of the store. The first + parameter <parameter>parent</parameter> can be <literal>NULL</literal>. + If that's the case, the new entry will have no parent and thus + be a "root" entry. + </para> + <para> + The second parameter <parameter>items</parameter> is an array with a value + for each column. If your treestore has three columns, the array should have + three values. + </para> + <para> + The method returns a <classname>GtkTreeIter</classname> which you can use + to refer to the entry row; e.g. to use it as a parent for another row. + </para> + <para> + If you pass no parameters at all, an empty row with no values will be + created, and you have to use other methods like + <function class="GtkTreeStore">set</function> to change the column values. + </para> + <para> + See also: + <function class="GtkTreeStore">append</function> + <function class="GtkTreeStore">insert</function>, + <function class="GtkTreeStore">insert_after</function>, + <function class="GtkTreeStore">insert_before</function>, + </para> </desc> </method> @@ -375,17 +460,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>remove</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Remove a row from the tree. </shortdesc> <desc> - + <para> + Removes a row specified by <parameter>iter</parameter> from the tree. + </para> </desc> </method> +<!-- <method id="gtk.gtktreestore.method.reorder"> <funcsynopsis> <funcprototype> @@ -400,22 +488,52 @@ </desc> </method> - +--> <method id="gtk.gtktreestore.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_1</parameter></paramdef> + <paramdef>mixed <parameter>value_1</parameter></paramdef> + <paramdef>int <parameter><optional>column_2</optional></parameter></paramdef> + <paramdef>mixed <parameter>value_2</parameter></paramdef> + <paramdef>...</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Set the values of a row. </shortdesc> <desc> - + <para> + Sets the values of the row specified by <parameter>iter</parameter>. + The parameters have to be pairs, determining the column id and the value + the column shall be set to. + </para> + <para> + This method is useful when you used + <function class="GtkTreeStore">insert</function> or one of its siblings + to create an empty row, or if you want to change multiple columns of a + row. + </para> + <example> + <title>Setting column values with set()</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/set.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: +<!-- <function class="GtkTreeStore">set_value</function>, --> + <function class="GtkTreeStore">append</function>, + <function class="GtkTreeStore">prepend</function> + </para> </desc> </method> - +<!-- <method id="gtk.gtktreestore.method.set_column_types"> <funcsynopsis> <funcprototype> @@ -460,22 +578,25 @@ </desc> </method> - +--> <method id="gtk.gtktreestore.method.swap"> <funcsynopsis> <funcprototype> <funcdef>void <function>swap</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter1</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter2</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Swaps two rows. </shortdesc> <desc> - + <para> + Swaps two rows on the same level. Works only with unsorted tree stores. + </para> </desc> </method> </methods> -</classentry> +</classentry> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/iter_depth.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/iter_depth.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/iter_depth.phpw <?php //Create the store $store = new GtkTreeStore(Gtk::TYPE_STRING); //Variable for the last inserted row $last = null; //loop from 0 to 10 for ($nA = 0; $nA <= 10; $nA++) { //append a row as child of $last //$last is NULL at first, so the row will be top-level $last = $store->append($last, array('row ' . $nA)); //display the depth of the created iterator echo 'Depth at level #' . $nA . ': ' . $store->iter_depth($last) . "\r\n"; } ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/iter_is_valid.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/iter_is_valid.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/iter_is_valid.phpw <?php //Create the store $store = new GtkTreeStore(Gtk::TYPE_STRING); //add a row and save the iter into $row $row = $store->append(null, array('row')); //that should return true, as the row exists var_dump($store->iter_is_valid($row)); //remove that row from the store $store->remove($row); //shouldn't be valid any more var_dump($store->iter_is_valid($row)); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/set.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/set.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/set.phpw <?php //A row in that store can hold a string, an integer and a float $store = new GtkTreeStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG, GTK::TYPE_DOUBLE); //create a new (empty) row $row = $store->insert(); //set value of the first row $store->set($row, 0, 'String'); //set value of the third and second row $store->set($row, 2, 0.5, 1, 20); //Display the store $wnd = new GtkWindow(); $view = new GtkTreeView($store); $rend = new GtkCellRendererText(); $view->append_column(new GtkTreeViewColumn('String', $rend, 'text', 0)); $view->append_column(new GtkTreeViewColumn('Int' , $rend, 'text', 1)); $view->append_column(new GtkTreeViewColumn('Float' , $rend, 'text', 2)); $wnd->add($view); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $wnd->show_all(); Gtk::main(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/move_after.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/move_after.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/move_after.phpw <?php //Create the store $store = new GtkTreeStore(Gtk::TYPE_STRING); //Create first row $row1 = $store->append(null, array('row 1')); //Create second row $row2 = $store->append(null, array('row 2')); //move $row1 after $row2 $store->move_after($row1, $row2); //Display the store $wnd = new GtkWindow(); $view = new GtkTreeView($store); $view->append_column( new GtkTreeViewColumn('String column', new GtkCellRendererText(), 'text', 0) ); $wnd->add($view); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $wnd->show_all(); Gtk::main(); ?>
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml?r1=1.4&r2=1.5&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.4 php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.5 --- php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.4 Wed Jan 18 11:36:48 2006 +++ php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml Wed Jan 18 18:51:41 2006 @@ -292,14 +292,27 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>iter_depth</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + How deep an iterator is nested in the tree. </shortdesc> <desc> - + <para> + Calculates how deep the given <parameter>iter</parameter> is nested in + the store. If the given iter is a top-level row, <literal>0</literal> + is returned. + </para> + <example> + <title>Using iter_depth to determine the depth of a row</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/iter_depth.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> @@ -307,14 +320,30 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>iter_is_valid</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + If a given row exists in the store. </shortdesc> <desc> - + <para> + Returns <literal>true</literal> if the given iterator points to a row + that exists in the model. + </para> + <para> + An iterator can get unvalid by removing it (or one of its parents) + from the tree. + </para> + <example> + <title>Checking an iter's validity by using iter_is_valid()</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/iter_is_valid.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> </desc> </method> @@ -322,18 +351,37 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>move_after</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Moves a given iter directly after another one. </shortdesc> <desc> <para> + Moves the row given by <parameter>iter</parameter> directly after + <parameter>position</parameter>. + </para> + <para> + That method works only with unsorted stores and requires both iters to + be at the same level. If <parameter>position</parameter> is + <literal>NULL</literal>, the row will be moved to the start + of the level. + </para> + <example> + <title>Moving rows</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/move_after.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> See also: - <function class="GtkTreeStore">insert_after</function> + <function class="GtkTreeStore">move_before</function> </para> - </desc> </method> @@ -341,33 +389,70 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>move_before</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Moves a given iter directly before another one. </shortdesc> <desc> <para> + Moves the row given by <parameter>iter</parameter> directly before + <parameter>position</parameter>. + </para> + <para> + That method works only with unsorted stores and requires both iters to + be at the same level. If <parameter>position</parameter> is + <literal>NULL</literal>, the row will be moved to the end + of the level. + </para> + <para> See also: - <function class="GtkTreeStore">insert_before</function> + <function class="GtkTreeStore">move_before</function> </para> - </desc> </method> <method id="gtk.gtktreestore.method.prepend"> <funcsynopsis> <funcprototype> - <funcdef>void <function>prepend</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>prepend</function></funcdef> + <paramdef><classname>GtkTreeIter</classname> <parameter><optional>parent</optional></parameter></paramdef> + <paramdef>array <parameter>items</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Add a row to the beginning of the store. </shortdesc> <desc> - + <para> + Creates a new line and inserts it at the beginning of the store. The first + parameter <parameter>parent</parameter> can be <literal>NULL</literal>. + If that's the case, the new entry will have no parent and thus + be a "root" entry. + </para> + <para> + The second parameter <parameter>items</parameter> is an array with a value + for each column. If your treestore has three columns, the array should have + three values. + </para> + <para> + The method returns a <classname>GtkTreeIter</classname> which you can use + to refer to the entry row; e.g. to use it as a parent for another row. + </para> + <para> + If you pass no parameters at all, an empty row with no values will be + created, and you have to use other methods like + <function class="GtkTreeStore">set</function> to change the column values. + </para> + <para> + See also: + <function class="GtkTreeStore">append</function> + <function class="GtkTreeStore">insert</function>, + <function class="GtkTreeStore">insert_after</function>, + <function class="GtkTreeStore">insert_before</function>, + </para> </desc> </method> @@ -375,17 +460,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>remove</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Remove a row from the tree. </shortdesc> <desc> - + <para> + Removes a row specified by <parameter>iter</parameter> from the tree. + </para> </desc> </method> +<!-- <method id="gtk.gtktreestore.method.reorder"> <funcsynopsis> <funcprototype> @@ -400,22 +488,52 @@ </desc> </method> - +--> <method id="gtk.gtktreestore.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_1</parameter></paramdef> + <paramdef>mixed <parameter>value_1</parameter></paramdef> + <paramdef>int <parameter><optional>column_2</optional></parameter></paramdef> + <paramdef>mixed <parameter>value_2</parameter></paramdef> + <paramdef>...</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Set the values of a row. </shortdesc> <desc> - + <para> + Sets the values of the row specified by <parameter>iter</parameter>. + The parameters have to be pairs, determining the column id and the value + the column shall be set to. + </para> + <para> + This method is useful when you used + <function class="GtkTreeStore">insert</function> or one of its siblings + to create an empty row, or if you want to change multiple columns of a + row. + </para> + <example> + <title>Setting column values with set()</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/set.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: +<!-- <function class="GtkTreeStore">set_value</function>, --> + <function class="GtkTreeStore">append</function>, + <function class="GtkTreeStore">prepend</function> + </para> </desc> </method> - +<!-- <method id="gtk.gtktreestore.method.set_column_types"> <funcsynopsis> <funcprototype> @@ -460,22 +578,25 @@ </desc> </method> - +--> <method id="gtk.gtktreestore.method.swap"> <funcsynopsis> <funcprototype> <funcdef>void <function>swap</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter1</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter2</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Swaps two rows. </shortdesc> <desc> - + <para> + Swaps two rows on the same level. Works only with unsorted tree stores. + </para> </desc> </method> </methods> -</classentry> +</classentry> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/iter_depth.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/iter_depth.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/iter_depth.phpw <?php //Create the store $store = new GtkTreeStore(Gtk::TYPE_STRING); //Variable for the last inserted row $last = null; //loop from 0 to 10 for ($nA = 0; $nA <= 10; $nA++) { //append a row as child of $last //$last is NULL at first, so the row will be top-level $last = $store->append($last, array('row ' . $nA)); //display the depth of the created iterator echo 'Depth at level #' . $nA . ': ' . $store->iter_depth($last) . "\r\n"; } ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/iter_is_valid.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/iter_is_valid.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/iter_is_valid.phpw <?php //Create the store $store = new GtkTreeStore(Gtk::TYPE_STRING); //add a row and save the iter into $row $row = $store->append(null, array('row')); //that should return true, as the row exists var_dump($store->iter_is_valid($row)); //remove that row from the store $store->remove($row); //shouldn't be valid any more var_dump($store->iter_is_valid($row)); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/set.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/set.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/set.phpw <?php //A row in that store can hold a string, an integer and a float $store = new GtkTreeStore(Gtk::TYPE_STRING, Gtk::TYPE_LONG, GTK::TYPE_DOUBLE); //create a new (empty) row $row = $store->insert(); //set value of the first row $store->set($row, 0, 'String'); //set value of the third and second row $store->set($row, 2, 0.5, 1, 20); //Display the store $wnd = new GtkWindow(); $view = new GtkTreeView($store); $rend = new GtkCellRendererText(); $view->append_column(new GtkTreeViewColumn('String', $rend, 'text', 0)); $view->append_column(new GtkTreeViewColumn('Int' , $rend, 'text', 1)); $view->append_column(new GtkTreeViewColumn('Float' , $rend, 'text', 2)); $wnd->add($view); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $wnd->show_all(); Gtk::main(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/move_after.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/move_after.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/move_after.phpw <?php //Create the store $store = new GtkTreeStore(Gtk::TYPE_STRING); //Create first row $row1 = $store->append(null, array('row 1')); //Create second row $row2 = $store->append(null, array('row 2')); //move $row1 after $row2 $store->move_after($row1, $row2); //Display the store $wnd = new GtkWindow(); $view = new GtkTreeView($store); $view->append_column( new GtkTreeViewColumn('String column', new GtkCellRendererText(), 'text', 0) ); $wnd->add($view); $wnd->connect_simple('destroy', array('gtk', 'main_quit')); $wnd->show_all(); Gtk::main(); ?>