cvs: php-gtk-doc /examples/reference/gtk/gtktreeselection multi.phpw /manual/en/reference/gtk gtkenum.xml gtktreeselection.xml
| From: | Christian Weiske | Date: | Sun, 26 Feb 2006 11:28:08 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtktreeselection multi.phpw /manual/en/reference/gtk gtkenum.xml gtktreeselection.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1870@lists.php.net to get a copy of this message | ||
cweiske Sun Feb 26 11:28:08 2006 UTC
Added files:
/php-gtk-doc/examples/reference/gtk/gtktreeselection multi.phpw
Modified files:
/php-gtk-doc/manual/en/reference/gtk gtkenum.xml
gtktreeselection.xml
Log:
GtkTreeSelection docs
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtkenum.xml?r1=1.14&r2=1.15&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.14 php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.15 --- php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.14 Tue Jan 31 16:05:19 2006 +++ php-gtk-doc/manual/en/reference/gtk/gtkenum.xml Sun Feb 26 11:28:08 2006 @@ -2665,12 +2665,17 @@ </enum> - <enum id="gtk.enum.selection"> - <enumname>GtkSelection</enumname> + <enum id="gtk.enum.selectionmode"> + <enumname>GtkSelectionMode</enumname> <desc> <simpara> Used to control what selections users are allowed to make. </simpara> + <para> + Used by methods of the <classname>GtkTreeSelection</classname> class; + <function class="GtkTreeSelection">set_mode</function> and + <function class="GtkTreeSelection">get_mode</function>. + </para> </desc> <enumoption> <value>0</value> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml?r1=1.4&r2=1.5&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml:1.4 php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml:1.5 --- php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml:1.4 Tue Aug 2 11:01:45 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml Sun Feb 26 11:28:08 2006 @@ -4,10 +4,37 @@ <classtitle>GtkTreeSelection</classtitle> <classparent>GObject</classparent> <shortdesc> - + Selection of a <classname>GtkTreeView</classname>. </shortdesc> <desc> - + <para> + The GtkTreeSelection object is a helper object to manage the selection for + a <classname>GtkTreeView</classname> widget. The GtkTreeSelection object + is automatically created when a new GtkTreeView widget is created, and + cannot exist independentally of this widget. The primary reason the + GtkTreeSelection objects exists is for cleanliness of code and API. + That is, there is no conceptual reason all these functions could not be + methods on the GtkTreeView widget instead of a separate function. + </para> + <para> + The GtkTreeSelection object is gotten from a + <classname>GtkTreeView</classname> by calling + <function class="GtkTreeView">get_selection</function>. It can be + manipulated to check the selection status of the tree, as well as select + and deselect individual rows. Selection is done completely view side. As a + result, multiple views of the same model can have completely different + selections. Additionally, you cannot change the selection of a row on the + model that is not currently displayed by the view without expanding its + parents first. + </para> + <para> + One of the important things to remember when monitoring the selection of + a view is that the <signalname class="GtkTreeSelection">changed</signalname> + signal is mostly a hint. That is, it may only emit one signal when a range + of rows is selected. Additionally, it may on occasion emit a + <literal>changed</literal>" signal when nothing has happened (mostly as a + result of programmers calling select_row on an already selected row). + </para> </desc> </classmeta> @@ -21,82 +48,141 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Returns the number of selected rows. </shortdesc> <desc> <para> - See also: + Returns the number of selected rows. + </para> + <para> + See also: + <function class="GtkTreeSelection">get_selected</function>, <function class="GtkTreeSelection">get_selected_rows</function> </para> - </desc> </method> <method id="gtk.gtktreeselection.method.get_mode"> <funcsynopsis> <funcprototype> - <funcdef>GtkSelectionMode <function>get_mode</function></funcdef> + <funcdef><enumname>GtkSelectionMode</enumname> <function>get_mode</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Gets the selection mode for selection. </shortdesc> <desc> <para> - See also: + Gets the selection mode for selection. The selection mode determines, how + the rows in the view may be selected (just one row, multiple rows, ...) + </para> + <para> + See also: <function class="GtkTreeSelection">set_mode</function> </para> - </desc> </method> <method id="gtk.gtktreeselection.method.get_selected"> <funcsynopsis> <funcprototype> - <funcdef>bool <function>get_selected</function></funcdef> + <funcdef>array <function>get_selected</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Get the selected row. </shortdesc> <desc> - + <para> + Returns an array containing the + <link linked="gtk.gtktreemodel">model</link> and the + <link linked="gtk.gtktreeiter">iterator</link> of the currently + selected row. + </para> + <para> + This method works only, if the + <link linked="gtk.enum.selectionmode">selection mode</link> is + <link linked="gtk.gtktreeselection.method.set_mode">set</link> + to <literal>Gtk::SELECTION_SINGLE</literal> or + <literal>Gtk::SELECTION_BROWSER</literal>. For other modes, + retrieve the selection with + <function class="GtkTreeSelection">get_selected_rows</function>. + </para> + <example> + <title>Using get_selected</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreeview/selection.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkTreeSelection">get_selected_rows</function> + </para> </desc> </method> <method id="gtk.gtktreeselection.method.get_selected_rows"> <funcsynopsis> <funcprototype> - <funcdef> <function>get_selected_rows</function></funcdef> + <funcdef>array <function>get_selected_rows</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Returns the selected rows for a multiselection. </shortdesc> <desc> <para> - See also: + Returns an array containing the + <link linked="gtk.gtktreemodel">model</link> and an array + of tree paths of the selected rows. The tree path array + can be walked by an <literal>foreach</literal> or + <literal>for</literal> loop, and the single paths can be converted + to an iterator via the <function class="GtkTreeModel">get_iter</function> + method of <classname>GtkTreeModel</classname>. + </para> + <para> + Unlike the <function class="GtkTreeSelection">get_selected</function> + method, this here works with all + <link linked="gtk.enum.selectionmode">selection modes</link>. + </para> + <example> + <title>Using get_selected_rows</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreeselection/multi.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkTreeSelection">get_selected</function> <function class="GtkTreeSelection">count_selected_rows</function> </para> - </desc> </method> <method id="gtk.gtktreeselection.method.get_tree_view"> <funcsynopsis> <funcprototype> - <funcdef>GtkTreeView <function>get_tree_view</function></funcdef> + <funcdef><classname>GtkTreeView</classname> <function>get_tree_view</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Returns the treeview. </shortdesc> <desc> - + <para> + Returns the <classname>GtkTreeView</classname> that this selection + object belongs to. + </para> </desc> </method> @@ -108,7 +194,7 @@ </funcprototype> </funcsynopsis> <shortdesc> - + FIXME </shortdesc> <desc> @@ -119,18 +205,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>iter_is_selected</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Checks if an iterator is selected or not. </shortdesc> <desc> <para> - See also: + Checks if the given iterator is selected or not. + </para> + <para> + See also: <function class="GtkTreeSelection">path_is_selected</function> </para> - </desc> </method> @@ -138,18 +226,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>path_is_selected</function></funcdef> - <paramdef>void</paramdef> + <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Checks if a tree path is selected or not. </shortdesc> <desc> <para> - See also: + Checks if the given tree path is selected or not. + </para> + <para> + See also: <function class="GtkTreeSelection">iter_is_selected</function> </para> - </desc> </method> @@ -161,14 +251,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Selects all rows. </shortdesc> <desc> <para> - See also: + Selects all rows. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_all</function> </para> - </desc> </method> @@ -176,18 +268,20 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_iter</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Selects a row. </shortdesc> <desc> <para> - See also: + Selects a row specified by <parameter>iter</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_iter</function> </para> - </desc> </method> @@ -195,18 +289,20 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_path</function></funcdef> - <paramdef>void</paramdef> + <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Selects a row. </shortdesc> <desc> <para> - See also: + Selects a row specified by <parameter>path</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_path</function> </para> - </desc> </method> @@ -214,18 +310,22 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_range</function></funcdef> - <paramdef>void</paramdef> + <paramdef>int <parameter>lower</parameter></paramdef> + <paramdef>int <parameter>upper</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Selects a given range of rows. </shortdesc> <desc> <para> - See also: + Selects the rows between <parameter>lower</parameter> and + <parameter>upper</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_range</function> </para> - </desc> </method> @@ -233,14 +333,18 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>selected_foreach</function></funcdef> - <paramdef>void</paramdef> + <paramdef>callback <parameter>function</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Calls a function for each selected row. </shortdesc> <desc> - + <para> + Calls the function or method specified by the + <parameter>function</parameter> parameter, once for each + of the rows selected. + </para> </desc> </method> @@ -248,18 +352,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_mode</function></funcdef> - <paramdef>GtkSelectionMode <parameter>type</parameter></paramdef> + <paramdef><enumname>GtkSelectionMode</enumname> <parameter>type</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets the selection mode. </shortdesc> <desc> <para> - See also: + Sets the selection mode. The selection mode determines, how + the rows in the view may be selected (just one row, multiple rows, ...) + </para> + <para> + See also: <function class="GtkTreeSelection">get_mode</function> </para> - </desc> </method> @@ -271,7 +378,7 @@ </funcprototype> </funcsynopsis> <shortdesc> - + FIXME </shortdesc> <desc> @@ -286,14 +393,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Deselects all rows. </shortdesc> <desc> <para> - See also: + Deselects all rows. After calling this method, no rows + are selected. + </para> + <para> + See also: <function class="GtkTreeSelection">select_all</function> </para> - </desc> </method> @@ -301,18 +411,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_iter</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Deselects an iterator. </shortdesc> <desc> <para> - See also: - <function class="GtkTreeSelection">select_iter</function> + Deselects the given iterator. + </para> + <para> + See also: + <function class="GtkTreeSelection">select_iter</function>, + <function class="GtkTreeSelection">unselect_path</function> </para> - </desc> </method> @@ -320,18 +433,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_path</function></funcdef> - <paramdef>void</paramdef> + <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Deselects a path. </shortdesc> <desc> <para> - See also: - <function class="GtkTreeSelection">select_path</function> + Deselects the given tree path. + </para> + <para> + See also: + <function class="GtkTreeSelection">select_path</function>, + <function class="GtkTreeSelection">unselect_iter</function> </para> - </desc> </method> @@ -339,18 +455,22 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_range</function></funcdef> - <paramdef>void</paramdef> + <paramdef>int <parameter>lower</parameter></paramdef> + <paramdef>int <parameter>upper</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Deselects a given range of rows. </shortdesc> <desc> <para> - See also: + Deselects all rows between <parameter>lower</parameter> and + <parameter>upper</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">select_range</function> </para> - </desc> </method> @@ -363,16 +483,24 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkTreeSelection <parameter>treeselection</parameter></paramdef> + <paramdef><classname>GtkTreeSelection</classname> <parameter>treeselection</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + One or more rows have been selected. </shortdesc> <desc> - + <para> + Called whenever one or more rows have been selected, or + some selected rows are unselected. It may also be called + when the program selects a row that is already selected. + </para> + <para> + See <function class="GtkTreeSelection">get_selected</function> + for an example. + </para> </desc> </signal> - </signals> </classentry> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreeselection/multi.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreeselection/multi.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreeselection/multi.phpw <?php //create a model $model = new GtkListStore(Gtk::TYPE_STRING); //create the view to display the model data $view = new GtkTreeView($model); //now, get the selection object of that view $selection = $view->get_selection(); //we want to be able to select multiple rows $selection->set_mode(Gtk::SELECTION_MULTIPLE); //capture the "changed" signal $selection->connect('changed', 'selection_changed'); /** * This is the callback function for the changed * signal and display the value of the first column * of all selected rows */ function selection_changed($selection) { list($model, $arPaths) = $selection->get_selected_rows(); echo "Selection is now:\r\n"; foreach ($arPaths as $path) { $iter = $model->get_iter($path); echo ' ' . $model->get_value($iter, 0) . "\r\n"; } }//function selection_changed($selection) //add a column to display the data $col = new GtkTreeViewColumn('Number', new GtkCellRendererText(), 'text', 0); $view->append_column($col); //add some data to the model/store $model->append(array('Zero')); $model->append(array('One')); $model->append(array('Two')); $model->append(array('Three')); $model->append(array('Four')); $model->append(array('Five')); $selection->select_range(1, -1); //add the view to the window $wnd = new GtkWindow(); $wnd->set_title('GtkTreeView selection example'); $wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $wnd->add($view); $wnd->show_all(); Gtk::main(); ?>
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtkenum.xml?r1=1.14&r2=1.15&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.14 php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.15 --- php-gtk-doc/manual/en/reference/gtk/gtkenum.xml:1.14 Tue Jan 31 16:05:19 2006 +++ php-gtk-doc/manual/en/reference/gtk/gtkenum.xml Sun Feb 26 11:28:08 2006 @@ -2665,12 +2665,17 @@ </enum> - <enum id="gtk.enum.selection"> - <enumname>GtkSelection</enumname> + <enum id="gtk.enum.selectionmode"> + <enumname>GtkSelectionMode</enumname> <desc> <simpara> Used to control what selections users are allowed to make. </simpara> + <para> + Used by methods of the <classname>GtkTreeSelection</classname> class; + <function class="GtkTreeSelection">set_mode</function> and + <function class="GtkTreeSelection">get_mode</function>. + </para> </desc> <enumoption> <value>0</value> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml?r1=1.4&r2=1.5&diff_format=u Index: php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml:1.4 php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml:1.5 --- php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml:1.4 Tue Aug 2 11:01:45 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtktreeselection.xml Sun Feb 26 11:28:08 2006 @@ -4,10 +4,37 @@ <classtitle>GtkTreeSelection</classtitle> <classparent>GObject</classparent> <shortdesc> - + Selection of a <classname>GtkTreeView</classname>. </shortdesc> <desc> - + <para> + The GtkTreeSelection object is a helper object to manage the selection for + a <classname>GtkTreeView</classname> widget. The GtkTreeSelection object + is automatically created when a new GtkTreeView widget is created, and + cannot exist independentally of this widget. The primary reason the + GtkTreeSelection objects exists is for cleanliness of code and API. + That is, there is no conceptual reason all these functions could not be + methods on the GtkTreeView widget instead of a separate function. + </para> + <para> + The GtkTreeSelection object is gotten from a + <classname>GtkTreeView</classname> by calling + <function class="GtkTreeView">get_selection</function>. It can be + manipulated to check the selection status of the tree, as well as select + and deselect individual rows. Selection is done completely view side. As a + result, multiple views of the same model can have completely different + selections. Additionally, you cannot change the selection of a row on the + model that is not currently displayed by the view without expanding its + parents first. + </para> + <para> + One of the important things to remember when monitoring the selection of + a view is that the <signalname class="GtkTreeSelection">changed</signalname> + signal is mostly a hint. That is, it may only emit one signal when a range + of rows is selected. Additionally, it may on occasion emit a + <literal>changed</literal>" signal when nothing has happened (mostly as a + result of programmers calling select_row on an already selected row). + </para> </desc> </classmeta> @@ -21,82 +48,141 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Returns the number of selected rows. </shortdesc> <desc> <para> - See also: + Returns the number of selected rows. + </para> + <para> + See also: + <function class="GtkTreeSelection">get_selected</function>, <function class="GtkTreeSelection">get_selected_rows</function> </para> - </desc> </method> <method id="gtk.gtktreeselection.method.get_mode"> <funcsynopsis> <funcprototype> - <funcdef>GtkSelectionMode <function>get_mode</function></funcdef> + <funcdef><enumname>GtkSelectionMode</enumname> <function>get_mode</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Gets the selection mode for selection. </shortdesc> <desc> <para> - See also: + Gets the selection mode for selection. The selection mode determines, how + the rows in the view may be selected (just one row, multiple rows, ...) + </para> + <para> + See also: <function class="GtkTreeSelection">set_mode</function> </para> - </desc> </method> <method id="gtk.gtktreeselection.method.get_selected"> <funcsynopsis> <funcprototype> - <funcdef>bool <function>get_selected</function></funcdef> + <funcdef>array <function>get_selected</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Get the selected row. </shortdesc> <desc> - + <para> + Returns an array containing the + <link linked="gtk.gtktreemodel">model</link> and the + <link linked="gtk.gtktreeiter">iterator</link> of the currently + selected row. + </para> + <para> + This method works only, if the + <link linked="gtk.enum.selectionmode">selection mode</link> is + <link linked="gtk.gtktreeselection.method.set_mode">set</link> + to <literal>Gtk::SELECTION_SINGLE</literal> or + <literal>Gtk::SELECTION_BROWSER</literal>. For other modes, + retrieve the selection with + <function class="GtkTreeSelection">get_selected_rows</function>. + </para> + <example> + <title>Using get_selected</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreeview/selection.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkTreeSelection">get_selected_rows</function> + </para> </desc> </method> <method id="gtk.gtktreeselection.method.get_selected_rows"> <funcsynopsis> <funcprototype> - <funcdef> <function>get_selected_rows</function></funcdef> + <funcdef>array <function>get_selected_rows</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Returns the selected rows for a multiselection. </shortdesc> <desc> <para> - See also: + Returns an array containing the + <link linked="gtk.gtktreemodel">model</link> and an array + of tree paths of the selected rows. The tree path array + can be walked by an <literal>foreach</literal> or + <literal>for</literal> loop, and the single paths can be converted + to an iterator via the <function class="GtkTreeModel">get_iter</function> + method of <classname>GtkTreeModel</classname>. + </para> + <para> + Unlike the <function class="GtkTreeSelection">get_selected</function> + method, this here works with all + <link linked="gtk.enum.selectionmode">selection modes</link>. + </para> + <example> + <title>Using get_selected_rows</title> + <programlisting role="php"> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="&directory.examples;/reference/gtk/gtktreeselection/multi.phpw" parse="text"> + <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + <para> + See also: + <function class="GtkTreeSelection">get_selected</function> <function class="GtkTreeSelection">count_selected_rows</function> </para> - </desc> </method> <method id="gtk.gtktreeselection.method.get_tree_view"> <funcsynopsis> <funcprototype> - <funcdef>GtkTreeView <function>get_tree_view</function></funcdef> + <funcdef><classname>GtkTreeView</classname> <function>get_tree_view</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Returns the treeview. </shortdesc> <desc> - + <para> + Returns the <classname>GtkTreeView</classname> that this selection + object belongs to. + </para> </desc> </method> @@ -108,7 +194,7 @@ </funcprototype> </funcsynopsis> <shortdesc> - + FIXME </shortdesc> <desc> @@ -119,18 +205,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>iter_is_selected</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Checks if an iterator is selected or not. </shortdesc> <desc> <para> - See also: + Checks if the given iterator is selected or not. + </para> + <para> + See also: <function class="GtkTreeSelection">path_is_selected</function> </para> - </desc> </method> @@ -138,18 +226,20 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>path_is_selected</function></funcdef> - <paramdef>void</paramdef> + <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Checks if a tree path is selected or not. </shortdesc> <desc> <para> - See also: + Checks if the given tree path is selected or not. + </para> + <para> + See also: <function class="GtkTreeSelection">iter_is_selected</function> </para> - </desc> </method> @@ -161,14 +251,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Selects all rows. </shortdesc> <desc> <para> - See also: + Selects all rows. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_all</function> </para> - </desc> </method> @@ -176,18 +268,20 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_iter</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Selects a row. </shortdesc> <desc> <para> - See also: + Selects a row specified by <parameter>iter</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_iter</function> </para> - </desc> </method> @@ -195,18 +289,20 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_path</function></funcdef> - <paramdef>void</paramdef> + <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Selects a row. </shortdesc> <desc> <para> - See also: + Selects a row specified by <parameter>path</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_path</function> </para> - </desc> </method> @@ -214,18 +310,22 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_range</function></funcdef> - <paramdef>void</paramdef> + <paramdef>int <parameter>lower</parameter></paramdef> + <paramdef>int <parameter>upper</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Selects a given range of rows. </shortdesc> <desc> <para> - See also: + Selects the rows between <parameter>lower</parameter> and + <parameter>upper</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">unselect_range</function> </para> - </desc> </method> @@ -233,14 +333,18 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>selected_foreach</function></funcdef> - <paramdef>void</paramdef> + <paramdef>callback <parameter>function</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Calls a function for each selected row. </shortdesc> <desc> - + <para> + Calls the function or method specified by the + <parameter>function</parameter> parameter, once for each + of the rows selected. + </para> </desc> </method> @@ -248,18 +352,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_mode</function></funcdef> - <paramdef>GtkSelectionMode <parameter>type</parameter></paramdef> + <paramdef><enumname>GtkSelectionMode</enumname> <parameter>type</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets the selection mode. </shortdesc> <desc> <para> - See also: + Sets the selection mode. The selection mode determines, how + the rows in the view may be selected (just one row, multiple rows, ...) + </para> + <para> + See also: <function class="GtkTreeSelection">get_mode</function> </para> - </desc> </method> @@ -271,7 +378,7 @@ </funcprototype> </funcsynopsis> <shortdesc> - + FIXME </shortdesc> <desc> @@ -286,14 +393,17 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Deselects all rows. </shortdesc> <desc> <para> - See also: + Deselects all rows. After calling this method, no rows + are selected. + </para> + <para> + See also: <function class="GtkTreeSelection">select_all</function> </para> - </desc> </method> @@ -301,18 +411,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_iter</function></funcdef> - <paramdef>void</paramdef> + <paramdef><classname>GtkTreeIter</classname> <parameter>iter</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Deselects an iterator. </shortdesc> <desc> <para> - See also: - <function class="GtkTreeSelection">select_iter</function> + Deselects the given iterator. + </para> + <para> + See also: + <function class="GtkTreeSelection">select_iter</function>, + <function class="GtkTreeSelection">unselect_path</function> </para> - </desc> </method> @@ -320,18 +433,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_path</function></funcdef> - <paramdef>void</paramdef> + <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Deselects a path. </shortdesc> <desc> <para> - See also: - <function class="GtkTreeSelection">select_path</function> + Deselects the given tree path. + </para> + <para> + See also: + <function class="GtkTreeSelection">select_path</function>, + <function class="GtkTreeSelection">unselect_iter</function> </para> - </desc> </method> @@ -339,18 +455,22 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_range</function></funcdef> - <paramdef>void</paramdef> + <paramdef>int <parameter>lower</parameter></paramdef> + <paramdef>int <parameter>upper</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Deselects a given range of rows. </shortdesc> <desc> <para> - See also: + Deselects all rows between <parameter>lower</parameter> and + <parameter>upper</parameter>. + </para> + <para> + See also: <function class="GtkTreeSelection">select_range</function> </para> - </desc> </method> @@ -363,16 +483,24 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkTreeSelection <parameter>treeselection</parameter></paramdef> + <paramdef><classname>GtkTreeSelection</classname> <parameter>treeselection</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + One or more rows have been selected. </shortdesc> <desc> - + <para> + Called whenever one or more rows have been selected, or + some selected rows are unselected. It may also be called + when the program selects a row that is already selected. + </para> + <para> + See <function class="GtkTreeSelection">get_selected</function> + for an example. + </para> </desc> </signal> - </signals> </classentry> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktreeselection/multi.phpw?view=markup&rev=1.1 Index: php-gtk-doc/examples/reference/gtk/gtktreeselection/multi.phpw +++ php-gtk-doc/examples/reference/gtk/gtktreeselection/multi.phpw <?php //create a model $model = new GtkListStore(Gtk::TYPE_STRING); //create the view to display the model data $view = new GtkTreeView($model); //now, get the selection object of that view $selection = $view->get_selection(); //we want to be able to select multiple rows $selection->set_mode(Gtk::SELECTION_MULTIPLE); //capture the "changed" signal $selection->connect('changed', 'selection_changed'); /** * This is the callback function for the changed * signal and display the value of the first column * of all selected rows */ function selection_changed($selection) { list($model, $arPaths) = $selection->get_selected_rows(); echo "Selection is now:\r\n"; foreach ($arPaths as $path) { $iter = $model->get_iter($path); echo ' ' . $model->get_value($iter, 0) . "\r\n"; } }//function selection_changed($selection) //add a column to display the data $col = new GtkTreeViewColumn('Number', new GtkCellRendererText(), 'text', 0); $view->append_column($col); //add some data to the model/store $model->append(array('Zero')); $model->append(array('One')); $model->append(array('Two')); $model->append(array('Three')); $model->append(array('Four')); $model->append(array('Five')); $selection->select_range(1, -1); //add the view to the window $wnd = new GtkWindow(); $wnd->set_title('GtkTreeView selection example'); $wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $wnd->add($view); $wnd->show_all(); Gtk::main(); ?>