cvs: php-gtk-doc /examples/test gtkiconview.phpw /manual/en/reference/gtk gtkiconview.xml

From: Date: Wed, 27 Jul 2005 11:45:24 +0000
Subject: cvs: php-gtk-doc /examples/test gtkiconview.phpw /manual/en/reference/gtk gtkiconview.xml
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-1478@lists.php.net to get a copy of this message
cweiske Wed Jul 27 07:45:24 2005 EDT Added files: /php-gtk-doc/examples/test gtkiconview.phpw Modified files: /php-gtk-doc/manual/en/reference/gtk gtkiconview.xml Log: GtkIconView documentation is nearly complete. Further to the examples directory (in which official examples used in the manual shall be collected), I created a examples/test/ directory in which all the internally used demo scripts are put it - the scripts we use to find out if and how something works. For example, the gtkiconview.phpw script has an additional window attached to the normal iconview window. There are many buttons which just dump out the return values of some functions or call some functions on the iconview object

http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkiconview.xml?r1=1.5&r2=1.6&ty=u Index: php-gtk-doc/manual/en/reference/gtk/gtkiconview.xml diff -u php-gtk-doc/manual/en/reference/gtk/gtkiconview.xml:1.5 php-gtk-doc/manual/en/reference/gtk/gtkiconview.xml:1.6 --- php-gtk-doc/manual/en/reference/gtk/gtkiconview.xml:1.5 Mon Jul 25 16:38:46 2005 +++ php-gtk-doc/manual/en/reference/gtk/gtkiconview.xml Wed Jul 27 07:45:23 2005 @@ -216,7 +216,7 @@ <method id="gtk.gtkiconview.method.get_model"> <funcsynopsis> <funcprototype> - <funcdef> <function>get_model</function></funcdef> + <funcdef><classname>GtkTreeStore</classname> <function>get_model</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> @@ -267,7 +267,7 @@ </funcprototype> </funcsynopsis> <shortdesc> - + FIXME - CAN'T GET WORKING </shortdesc> <desc> @@ -401,14 +401,27 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>item_activated</function></funcdef> - <paramdef>void</paramdef> + <paramdef>GtkTreePath <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Activates an item. </shortdesc> <desc> - + <para> + Activates the item at the given path. Note that <emphasis>activate</emphasis> + does not mean <emphasis>select</emphasis>. Activation is something like an + internal, invisible selection. + <!-- FIXME: What is activation in reality? --> + </para> + <para> + Causes the <signalname class="GtkIconView">item-activated</signalname> signal + to be emitted. + </para> + <para> + See <function class="GtkIconView">select_path</function> if you want + to select an item. + </para> </desc> </method> @@ -416,14 +429,28 @@ <funcsynopsis> <funcprototype> <funcdef>bool <function>path_is_selected</function></funcdef> - <paramdef>void</paramdef> + <paramdef><!-- FIXME: where is GtkTreePath described? -->GtkTreePath <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Checks if an item is selected. </shortdesc> <desc> - + <para> + Checks if an item with a certain path is selected. + </para> + <para> + A tree path is a string of numbers and colons, e.g. + <literal>0:1:0</literal> which would point to the first child + of the second child of the first item in a tree. + As we won't have trees here, a simple + <informalexample> + <programlisting role="php"> + <![CDATA[$iconview->path_is_selected(15);]]> + </programlisting> + </informalexample> + is enough to check if the fifteenth item is selected. + </para> </desc> </method> @@ -444,7 +471,8 @@ </para> <para> See also: - <function class="GtkIconView">unselect_all</function> + <function class="GtkIconView">unselect_all</function>, + <function class="GtkIconView">select_path</function> </para> </desc> </method> @@ -453,21 +481,35 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_path</function></funcdef> - <paramdef>void</paramdef> + <paramdef><!-- FIXME: link to the path explanation -->GtkTreePath <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Select an item in the view. </shortdesc> <desc> <para> + Selects the item given in <literal>path</literal>. For example, + <informalexample> + <programlisting role="php"> + <![CDATA[$iconview->select_path(23);]]> + </programlisting> + </informalexample> + would select the 23rd item in the list. + </para> + <note> + <simpara> + Counting begins at 0. + </simpara> + </note> + <para> See also: - <function class="GtkIconView">unselect_path</function> + <function class="GtkIconView">unselect_path</function>, + <function class="GtkIconView">select_all</function> </para> - </desc> </method> - +<!-- <method id="gtk.gtkiconview.method.selected_foreach"> <funcsynopsis> <funcprototype> @@ -476,13 +518,13 @@ </funcprototype> </funcsynopsis> <shortdesc> - + DOES NOT EXIST! </shortdesc> <desc> </desc> </method> - +--> <method id="gtk.gtkiconview.method.set_column_spacing"> <funcsynopsis> <funcprototype> @@ -618,7 +660,7 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_model</function></funcdef> - <paramdef><classname>GtkListStore</classname> <parameter>model</parameter></paramdef> + <paramdef><classname>GtkTreeStore</classname> <parameter>model</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> @@ -807,7 +849,8 @@ </para> <para> See also: - <function class="GtkIconView">select_all</function> + <function class="GtkIconView">select_all</function>, + <function class="GtkIconView">unselect_path</function> </para> </desc> </method> @@ -816,18 +859,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_path</function></funcdef> - <paramdef>void</paramdef> + <paramdef>GtkTreePath <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Unselects a single item. </shortdesc> <desc> <para> + Sets the selected-state of the given item to unselected. + </para> + <para> See also: - <function class="GtkIconView">select_path</function> + <function class="GtkIconView">select_path</function>, + <function class="GtkIconView">unselect_all</function> </para> - </desc> </method> @@ -840,13 +886,21 @@ <funcsynopsis> <funcprototype> <funcdef>bool <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + The current cursor item has been activated. </shortdesc> <desc> - + <para> + This signal tells you that the current cursor item has + been activated with <function>item_activated</function>. + </para> + <para> + See <signalname class="GtkIconView">move-cursor</signalname> for an + explanation of what a <emphasis>cursor</emphasis> is. + </para> </desc> </signal> @@ -855,14 +909,17 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> <paramdef><!-- was: GtkTreePath -->XXX <parameter>UNKNOWN</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + An item has been activated (not selected) </shortdesc> <desc> - + <para> + Emitted when an item has been activated with <function>item_activated</function>. + </para> </desc> </signal> @@ -871,15 +928,33 @@ <funcsynopsis> <funcprototype> <funcdef>bool <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> - <paramdef>GtkMovementStep <parameter>UNKNOWN</parameter></paramdef> - <paramdef>int <parameter>UNKNOWN</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> + <paramdef><enumname>GtkMovementStep</enumname> <parameter>movement</parameter></paramdef> + <paramdef>int <parameter>direction<!-- FIXME: is it really the direction? --></parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + Cursor (not selection) has moved. </shortdesc> <desc> - + <para> + Emitted when the cursor (not the selection) has moved. + </para> + <para> + You can move the cursor by pressing <literal>Ctrl</literal> and one of the arrow keys: + There will be a dotted rectangle around the label of the current "cursor" item. + By pressing <literal>space</literal> you can (un)select it. + </para> + <para> + The <literal>movement</literal> parameter will be <literal>1</literal> + (Gtk::MOVEMENT_VISUAL_POSITIONS) when moving the cursor left or right, and + <literal>3</literal> (Gtk::MOVEMENT_DISPLAY_LINES) when moving up or down. + </para> + <para> + FIXME: The second parameter seems to be <literal>-1</literal> or + <literal>1</literal> only, depending on the direction + (backward or forward) you move. + </para> </desc> </signal> @@ -888,10 +963,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + FIXME<!--: When do I get this? There is always a selection-changed but no select-all!--> </shortdesc> <desc> @@ -903,10 +979,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + FIXME </shortdesc> <desc> @@ -918,13 +995,17 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + Emitted when the selection has changed. </shortdesc> <desc> - + <para> + This signal is emitted when the user (or the program) has changed the + selection by selecting or unselecting one or more items. + </para> </desc> </signal> @@ -933,48 +1014,65 @@ <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> - <paramdef>GtkAdjustment <parameter>UNKNOWN</parameter></paramdef> - <paramdef>GtkAdjustment <parameter>UNKNOWN</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkAdjustment</classname> <parameter>UNKNOWN</parameter></paramdef> + <paramdef><classname>GtkAdjustment</classname> <parameter>UNKNOWN</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + When the widget gets scroll bars. </shortdesc> <desc> - + <para> + The signal is emitted when the view gets scrollbars set. + </para> + <note> + <para> + It does <emphasis>not</emphasis> occur when the user scrolls the list. + </para> + </note> </desc> </signal> - + <signal id="gtk.gtkiconview.signal.toggle-cursor-item"> <signalname>toggle-cursor-item</signalname> <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + Current cursor item changes its selection state. </shortdesc> <desc> - + <para> + Emitted when the item of the current cursor changes its selection state + (get selected or unselected). + </para> + <para> + See <signalname class="GtkIconView">move-cursor</signalname> for an + explanation of what a <emphasis>cursor</emphasis> is. + </para> </desc> </signal> - + <signal id="gtk.gtkiconview.signal.unselect-all"> <signalname>unselect-all</signalname> <funcsynopsis> <funcprototype> <funcdef>void <cbfunction>callback</cbfunction></funcdef> - <paramdef>GtkIconView <parameter>iconview</parameter></paramdef> + <paramdef><classname>GtkIconView</classname> <parameter>iconview</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> + FIXME <!--: When do I get this? There is always a selection-changed but no unselect-all!--> </shortdesc> <desc> </desc> </signal> - + </signals> </classentry> http://cvs.php.net/co.php/php-gtk-doc/examples/test/gtkiconview.phpw?r=1.1&p=1 Index: php-gtk-doc/examples/test/gtkiconview.phpw +++ php-gtk-doc/examples/test/gtkiconview.phpw <?php //GtkIconView example $wnd = new GtkWindow(); $wnd->set_title('GtkIconView'); $wnd->set_default_size(400, 400); $wnd->connect_object('destroy', array('gtk', 'main_quit')); $iv = new GtkIconView(); $iv->set_selection_mode(Gtk::SELECTION_MULTIPLE); $model = new GtkListStore(GdkPixbuf::gtype, Gtk::TYPE_STRING); $iv->set_model($model); //fill the model with some nice icons $ids = Gtk::stock_list_ids(); sort($ids); foreach ($ids as $id) { $pixbuf = $iv->render_icon($id, Gtk::ICON_SIZE_DIALOG); $model->set($model->append(), 0, $pixbuf, 1, $id); } $iv->set_pixbuf_column(0); $iv->set_text_column(1); //number of columns in view, not model $iv->set_columns(0); $iv->set_item_width(100); //make it scrollable $scrollwin = new GtkScrolledWindow(); $scrollwin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); $scrollwin->add($iv); $wnd->add($scrollwin); $wnd->show_all(); function addButton($function, $box, $parameter, $direct = false) { $btn = new GtkButton($function); if ($direct) { $btn->connect_object('clicked', array($parameter, $function)); } else { $btn->connect_object('clicked', 'dump_' . $function, $parameter); } $box->pack_start($btn); }//function addButton($function, $box, $parameter) function dump_get_path_at_pos($iv) { var_dump($iv->get_path_at_pos(1, 1)); } function dump_item_activated($iv) { var_dump($iv->item_activated('1')); var_dump($iv->item_activated('3')); } function dump_path_is_selected($iv) { var_dump($iv->path_is_selected('0')); } function dump_selected_foreach($iv) { $iv->selected_foreach('dump_selected_foreach2', 'data'); } function dump_selected_foreach2($item, $data) { var_dump($item, $data); } function dump_select_path($iv) { $items = $iv->get_model()->iter_n_children(null); for ($nA = 0; $nA < $items; $nA = $nA + 2) { $iv->select_path($nA); } } function dump_set_scroll_adjustments($iv) { $scrollwin = $iv->get_parent(); $adj = $scrollwin->get_hadjustment(); $adj->set_value(10); // var_dump($adj); } /* signals */ function activate_cursor_item($obj) { var_dump('activate_cursor_item', $obj); } function item_activated($obj) { var_dump('item_activated', $obj); } function move_cursor($movement_step, $obj) { var_dump('move_cursor', $movement_step, $obj); } function select_all() { var_dump('select_all'); } function select_cursor_item($obj) { var_dump('select_cursor_item', $obj); } function selection_changed() { var_dump('selection_changed'); } function set_scroll_adjustments($obj) { var_dump('set_scroll_adjustments', $obj); } function toggle_cursor_item($obj) { var_dump('toggle_cursor_item', $obj); } function unselect_all() { var_dump('unselect_all'); } //extra window $wnd2 = new GtkWindow(); $wnd2->set_title('Extra test'); $wnd2->set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY); $box = new GtkVBox(); addButton('get_path_at_pos' , $box, $iv); addButton('item_activated' , $box, $iv); addButton('path_is_selected', $box, $iv); addButton('selected_foreach', $box, $iv); addButton('select_path' , $box, $iv); addButton('select_all' , $box, $iv, true); addButton('unselect_all' , $box, $iv, true); addButton('set_scroll_adjustments', $box, $iv); $iv->connect_object('activate-cursor-item' , 'activate_cursor_item'); $iv->connect_object('item-activated' , 'item_activated'); $iv->connect_object('move-cursor' , 'move_cursor'); $iv->connect_object('select-all' , 'select_all'); $iv->connect_object('select-cursor-item' , 'select_cursor_item'); $iv->connect_object('selection-changed' , 'selection_changed'); $iv->connect_object('set-scroll-adjustments', 'set_scroll_adjustments'); $iv->connect_object('toggle-cursor-item' , 'toggle_cursor_item'); $iv->connect_object('unselect-all' , 'unselect_all'); $wnd2->add($box); $wnd2->show_all(); Gtk::main(); ?>
« previous php.gtk.doc (#1478) next »