cvs: php-gtk-doc /examples/reference/gtk/gtktreestore insert.phpw insert_after.phpw insert_before.phpw /manual/en/reference/gtk gtktreestore.xml

From: Date: Wed, 18 Jan 2006 11:36:48 +0000
Subject: cvs: php-gtk-doc /examples/reference/gtk/gtktreestore insert.phpw insert_after.phpw insert_before.phpw /manual/en/reference/gtk gtktreestore.xml
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-1767@lists.php.net to get a copy of this message
cweiske Wed Jan 18 11:36:48 2006 UTC Added files: /php-gtk-doc/examples/reference/gtk/gtktreestore insert.phpw insert_after.phpw insert_before.phpw Modified files: /php-gtk-doc/manual/en/reference/gtk gtktreestore.xml Log: Some more exmaples for GtkTreestore

http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml?r1=1.3&r2=1.4&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.3 php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.4 --- php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml:1.3 Wed Jan 18 10:06:27 2006 +++ php-gtk-doc/manual/en/reference/gtk/gtktreestore.xml Wed Jan 18 11:36:48 2006 @@ -99,6 +99,13 @@ </xi:include> </programlisting> </example> + <para> + See also: + <function class="GtkTreeStore">insert</function>, + <function class="GtkTreeStore">insert_after</function>, + <function class="GtkTreeStore">insert_before</function>, + <function class="GtkTreeStore">prepend</function> + </para> </desc> </method> @@ -123,53 +130,140 @@ <method id="gtk.gtktreestore.method.insert"> <funcsynopsis> <funcprototype> - <funcdef>void <function>insert</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>insert</function></funcdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>parent</parameter></paramdef> + <paramdef>int <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Insert a new row at the given position. </shortdesc> <desc> - + <para> + Inserts a new row as child of <parameter>parent</parameter> at + <parameter>position</parameter>. + </para> + <para> + If <parameter>parent</parameter> is <literal>NULL</literal>, the new row + will be created at top-level. If <parameter>position</parameter> is + larger than the number of rows at that level, then the new row will + be inserted to the end of the list. + </para> + <para> + The newly inserted row has no values set; you have to use + <function class="GtkTreeStore">set</function> or + <function class="GtkTreeStore">set_value</function> to change them. + </para> + <example> + <title>Filling a GtkTreeStore with insert</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/insert.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">insert_before</function>, + <function class="GtkTreeStore">append</function>, + <function class="GtkTreeStore">prepend</function> + </para> </desc> </method> <method id="gtk.gtktreestore.method.insert_after"> <funcsynopsis> <funcprototype> - <funcdef>void <function>insert_after</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>insert_after</function></funcdef> + <paramdef><classname>GtkTreeIter</classname> <parameter><optional>parent</optional></parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter><optional>sibling</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Insert a new row after a given one. </shortdesc> <desc> <para> - See also: - <function class="GtkTreeStore">move_after</function> + Inserts a new row after <parameter>sibling</parameter>. If sibling is + <literal>NULL</literal>, then the row will be prepended to parent's + children. If <parameter>parent</parameter> and + <parameter>sibling</parameter> are <literal>NULL</literal>, then the row + will be prepended to the toplevel. If both <parameter>sibling</parameter> + and <parameter>parent</parameter> are set, then + <parameter>parent</parameter> must be the parent of + <parameter>sibling</parameter>. When <parameter>sibling</parameter> is + set, <parameter>parent</parameter> is optional. + </para> + <para> + The newly inserted row has no values set; you have to use + <function class="GtkTreeStore">set</function> or + <function class="GtkTreeStore">set_value</function> to change them. + </para> + <example> + <title>Filling a GtkTreeStore with insert_after</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/insert_after.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkTreeStore">insert</function>, + <function class="GtkTreeStore">insert_before</function>, + <function class="GtkTreeStore">append</function>, + <function class="GtkTreeStore">prepend</function> </para> - </desc> </method> <method id="gtk.gtktreestore.method.insert_before"> <funcsynopsis> <funcprototype> - <funcdef>void <function>insert_before</function></funcdef> - <paramdef>void</paramdef> + <funcdef><classname>GtkTreeIter</classname> <function>insert_before</function></funcdef> + <paramdef><classname>GtkTreeIter</classname> <parameter><optional>parent</optional></parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter><optional>sibling</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Insert a new row before a given one. </shortdesc> <desc> <para> - See also: - <function class="GtkTreeStore">move_before</function> + Inserts a new row before <parameter>sibling</parameter>. If sibling is + <literal>NULL</literal>, then the row will be appended to parent's + children. If <parameter>parent</parameter> and + <parameter>sibling</parameter> are <literal>NULL</literal>, then the row + will be appended to the toplevel. If both <parameter>sibling</parameter> + and <parameter>parent</parameter> are set, then + <parameter>parent</parameter> must be the parent of + <parameter>sibling</parameter>. When <parameter>sibling</parameter> is + set, <parameter>parent</parameter> is optional. + </para> + <para> + The newly inserted row has no values set; you have to use + <function class="GtkTreeStore">set</function> or + <function class="GtkTreeStore">set_value</function> to change them. + </para> + <example> + <title>Filling a GtkTreeStore with insert_before</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreestore/insert_before.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkTreeStore">insert</function>, + <function class="GtkTreeStore">insert_after</function>, + <function class="GtkTreeStore">append</function>, + <function class="GtkTreeStore">prepend</function> </para> - </desc> </method> @@ -177,14 +271,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>is_ancestor</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>descendant</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Checks if an iter is parent or grandparent of another iter. </shortdesc> <desc> - + <para> + Returns <literal>TRUE</literal> if <parameter>iter</parameter> is an + ancestor of <parameter>descendant</parameter>. That is, + <parameter>iter</parameter> is the parent (or grandparent or + great-grandparent) of <parameter>descendant</parameter>. + </para> </desc> </method> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreestore/insert.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/insert.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/insert.phpw <?php //new model with just one column of type string $store = new GtkTreeStore(Gtk::TYPE_STRING); //insert a new row without a parent (root row) $root = $store->insert(null, 0); $store->set($root, 0, 'root'); //insert a new row as child of the previously created root row $child1 = $store->insert($root, 0); $store->set($child1, 0, 'child'); //insert another row, but at position 0 - that means //before $child1 $child2 = $store->insert($root, 0); $store->set($child2, 0, 'child 2'); //insert at position 1: before $child1, //but after $child2 $child3 = $store->insert($root, 1); $store->set($child3, 0, 'child 3'); //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/examples/reference/gtk/gtktreestore/insert_after.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/insert_after.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/insert_after.phpw <?php //new model with just one column of type string $store = new GtkTreeStore(Gtk::TYPE_STRING); //insert a new row without a parent (root row) $root = $store->insert_after(); $store->set($root, 0, 'root'); //insert this child as child of root row $child1 = $store->insert_after($root); $store->set($child1, 0, 'child1'); //insert this child after $child1 $child2 = $store->insert_after($root, $child1); $store->set($child2, 0, 'child2'); //insert new child after $child1, making $child2 //moving to position 2 $child3 = $store->insert_after($root, $child1); $store->set($child3, 0, 'child3'); //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/examples/reference/gtk/gtktreestore/insert_before.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreestore/insert_before.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreestore/insert_before.phpw <?php //new model with just one column of type string $store = new GtkTreeStore(Gtk::TYPE_STRING); //insert a new row without a parent (root row) $root = $store->insert_after(); $store->set($root, 0, 'root'); //insert root2 before $root $root2 = $store->insert_before(null, $root); $store->set($root2, 0, 'root2'); //insert this child as child of root row $child1 = $store->insert_before($root); $store->set($child1, 0, 'child1'); //insert this child before $child1 $child2 = $store->insert_before($root, $child1); $store->set($child2, 0, 'child2'); //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(); ?>
« previous php.gtk.doc (#1767) next »