cvs: php-gtk-doc /en/reference/gdk gdkenum.xml /en/reference/gtk gtkcombo.xml gtkoptionmenu.xml gtkradiomenuitem.xml
| From: | Steph Fox | Date: | Tue, 12 Feb 2002 02:33:35 +0000 |
| Subject: | cvs: php-gtk-doc /en/reference/gdk gdkenum.xml /en/reference/gtk gtkcombo.xml gtkoptionmenu.xml gtkradiomenuitem.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-396@lists.php.net to get a copy of this message | ||
sfox Mon Feb 11 21:33:35 2002 EDT
Modified files:
/php-gtk-doc/en/reference/gdk gdkenum.xml
/php-gtk-doc/en/reference/gtk gtkcombo.xml gtkoptionmenu.xml
gtkradiomenuitem.xml
Log:
GtkCombo (finally) & some bits
Index: php-gtk-doc/en/reference/gdk/gdkenum.xml diff -u php-gtk-doc/en/reference/gdk/gdkenum.xml:1.8 php-gtk-doc/en/reference/gdk/gdkenum.xml:1.9 --- php-gtk-doc/en/reference/gdk/gdkenum.xml:1.8 Sat Feb 9 10:27:11 2002 +++ php-gtk-doc/en/reference/gdk/gdkenum.xml Mon Feb 11 21:33:35 2002 @@ -549,10 +549,7 @@ <enum id="gdk.enum.gdkmodifiertype"> <enumname>GdkModifierType</enumname> - <!-- - TODO - get someone who has access to drag and drop to complete the button - modifier details! - number of presses or position of button? - sf Jan 2002 - --> + <enumoption> <optionname>GDK_SHIFT_MASK</optionname> <shortdesc> Index: php-gtk-doc/en/reference/gtk/gtkcombo.xml diff -u php-gtk-doc/en/reference/gtk/gtkcombo.xml:1.4 php-gtk-doc/en/reference/gtk/gtkcombo.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtkcombo.xml:1.4 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkcombo.xml Mon Feb 11 21:33:35 2002 @@ -7,7 +7,106 @@ Text entry field with a dropdown list. </shortdesc> <desc> - + <simpara> + A <classname>GtkCombo</classname> appears to be the equivalent of the + <literal>select</literal> element in HTML. This can be misleading if + you're coming directly from a web development background; a GUI widget + is largely about appearance, and carrying hidden values is not something + this one will do without a little programming. Luckily, there are a trio + of invaluable <classname>GtkObject</classname> methods that will do just + that, with any object and with any form of data. These are + <function class="GtkObject">get_data()</function>, + <function class="GtkObject">set_data()</function> and + <function class="GtkObject">remove_data()</function>. See the sample + under <classname>GtkCombo</classname>'s + <link linkend="gtk.gtkcombo.constructor">constructor</link> to get an + idea of their usage. + </simpara> + <para> + There are a few key bindings in the combo widget. Most of them have + some bearing on searches. + <table> + <title>Key bindings in GtkCombo</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Key combination</entry> + <entry>Function</entry> + </row> + </thead> + <tbody> + <row> + <entry>Return (from the entry box)</entry> + <entry> + Opens up the list. If the entry contains text that fully matches + a list item's content, that list item will be selected on opening. + </entry> + </row> + <row> + <entry>Tab + MOD_1 mask (from the entry box)</entry> + <entry> + The MOD_1 modifier is usually <literal>Alt</literal>. This key + combination auto-completes a partial entry. + </entry> + </row> + <row> + <entry>Arrow up (from the entry box)</entry> + <entry> + If <literal>use_arrows</literal> has been set to + <literal>true</literal>, scrolls up through the list without opening + the list window. Can also be achieved with keypad arrow or + <literal>Alt + p</literal>. + </entry> + </row> + <row> + <entry>Arrow down (from the entry box)</entry> + <entry> + If <literal>use_arrows</literal> has been set to + <literal>true</literal>, scrolls down through the list without + opening the list window. Can also be achieved with keypad arrow + or <literal>Alt + n</literal>. + </entry> + </row> + <row> + <entry>Return (from the list box)</entry> + <entry> + Toggles the list item that has current focus. + </entry> + </row> + <row> + <entry>Spacebar (from the list box)</entry> + <entry> + Selects the list item that has current focus. + </entry> + </row> + <row> + <entry>Up arrow (from the list box)</entry> + <entry> + Scrolls up through the list items. + </entry> + </row> + <row> + <entry>Down arrow (from the list box)</entry> + <entry> + Scrolls down through the list items. + </entry> + </row> + <row> + <entry>Esc (from the list box)</entry> + <entry> + Removes grab from the list box, which closes it. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <simpara> + See also: <classname>GtkEditable</classname>, + <classname>GtkEntry</classname>, <classname>GtkItem</classname>, + <classname>GtkList</classname>, <classname>GtkListItem</classname>, + <classname>GtkOptionMenu</classname>. + </simpara> </desc> </classmeta> @@ -19,10 +118,87 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates an entry box with a dropdown list. </shortdesc> <desc> - + <simpara> + When the <classname>GtkListItem</classname> has been selected in a + <classname>GtkCombo</classname>, the combo's entry text is picked up + from the item, and the combo's list is searched for a data match. The + <signalname class="GtkList">unselect-child</signalname> signal is fired + by the list during this routine in order to clear previously existing + data. If you connect to either that or the + <signalname class="GtkListItem">deselect</signalname> signal, your + callback function will run twice. The same applies to the + <signalname class="GtkList">select-child</signalname> and + <signalname class="GtkListItem">select</signalname> signals, as the + deselection allows the item to be selected again - which it is, when + <function class="GtkList">select_child()</function> is called immediately + afterwards. + </simpara> + <simpara> + There are many ways of working around this. One is given in the sample + below. + </simpara> + <para> + <example> + <title>Associating data with a GtkListItem</title> + <programlisting role="php"> +dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : +"so")); + +function on_click($item, $event, $i) { + echo $item->get_data($i)."\n"; + flush(); +} + +function on_key($item, $i) { + echo $item->get_data($i)."\n"; + flush(); +} + +$window = &new GtkWindow(); +$window->set_position(GTK_WIN_POS_CENTER); +$window->connect_object("destroy", array("gtk", +"main_quit")); + +$combo = &new GtkCombo(); +/* The GtkEntry and GtkList are accessible through the combo's properties */ +$entry = $combo->entry; +$entry->set_text('Choose some fruit'); +$list = $combo->list; +$list->set_selection_mode(GTK_SELECTION_SINGLE); + +$fruit = array('apples', 'bananas', 'cherries', 'damsons', 'eggplants', +'figs', 'grapes'); + +for($i = 0; $i < count($fruit); $i++) { + $item = &new GtkListItem(); +/* You can put pretty much anything into a GtkListItem */ + $box = &new GtkHBox(); + $arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_OUT); + $box->pack_start($arrow, false, false, 5); + $label = &new GtkLabel('Item '.($i+1)); + $box->pack_start($label, false, false, 10); + $item->add($box); + $combo->set_item_string($item, "You chose $fruit[$i]"); + $data = $fruit[$i]; +/* This data will be carried with the $item. The key here is $i. */ + $item->set_data($i, $data); +/* Two separate signals to get around the 'select' problem. */ + $item->connect('button-press-event', 'on_click', $i); + $item->connect('toggle', 'on_key', $i); + $list->add($item); + $item->show_all(); +} + +$window->add($combo); +$window->show_all(); + +gtk::main(); + </programlisting> + </example> + </para> </desc> </constructor> @@ -32,15 +208,20 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_value_in_list</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> - <paramdef>int <parameter>ok_if_empty</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>ok_if_empty</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether entry value must be matched in list. </shortdesc> <desc> - + <simpara> + This method used to make the combo emit a beep if the entry value + could not be matched in the list. It no longer does this, and nor + does it print an error message when the search string is invalid. + Effectively broken. + </simpara> </desc> </method> @@ -48,14 +229,24 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_use_arrows</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether list can be scrolled within entry box. </shortdesc> <desc> - + <simpara> + <function class="GtkCombo">set_use_arrows()</function>, when set to + <literal>false</literal> prevents the <literal>Up</literal> and + <literal>Down</literal> arrow keys from being used to scroll the list + within the combo's entry box. + </simpara> + <simpara> + The default value is <literal>true</literal>, which allows such scrolling + where there is a match between the entry text and one of the list item + strings. + </simpara> </desc> </method> @@ -63,14 +254,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_use_arrows_always</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether entry box list-scrolling should loop. </shortdesc> <desc> - + <simpara> + This method is the adult version of + <function class="GtkCombo">set_use_arrows()</function>. The chief + difference is that the entry box text does not need to match the + text string in a list item in order for the arrows to be used. The + secondary difference is that the scrolling loops back to the start of + the list when the final item is reached, and vice versa. + </simpara> </desc> </method> @@ -78,14 +276,24 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_case_sensitive</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether matching should be case-sensitive. </shortdesc> <desc> - + <simpara> + <function class="GtkCombo">set_case_sensitve()</function>, if set + to <literal>true</literal>, will not match items that are dissimilar + with regard to case -in other words, <literal>Cat</literal> is not + the same thing as <literal>cat</literal>. + </simpara> + <simpara> + The default behaviour is that a string in the combo's entry box that is + accurate in all the ways other than case will be altered to match the + list version of that string. + </simpara> </desc> </method> @@ -93,30 +301,88 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_item_string</function></funcdef> - <paramdef><classname>GtkItem</classname> <parameter>item</parameter></paramdef> + <paramdef> + <classname>GtkItem</classname> <parameter>item</parameter> + </paramdef> <paramdef>string <parameter>item_value</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets string associated with list item. </shortdesc> <desc> - + <simpara> + As you may have noticed in the <classname>GtkCombo</classname> + constructor example, it is not by any means essential that the + items in a <classname>GtkList</classname> are + <classname>GtkListItem</classname>s. This method is intended to + provide a way to give an alternative to the entry box, where only + the string data type is allowed. + </simpara> + <simpara> + <function class="GtkCombo">set_item_string()</function> can be set + regardless of whether there is already text in the list item, and + in either case will provide the string that is compared against the + entry's text content during search routines. + </simpara> + <note> + <simpara> + This method determines the string that will be displayed in the + entry field after the list item has been selected. + </simpara> + </note> </desc> </method> <method id="gtk.gtkcombo.method.set_popdown_strings"> <funcsynopsis> <funcprototype> - <funcdef>XXX <function>set_popdown_strings</function></funcdef> - <paramdef>XXX</paramdef> + <funcdef>array <function>set_popdown_strings</function></funcdef> + <paramdef>array item_labels</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Simple list construction. </shortdesc> <desc> - + <simpara> + Use this method to create the <classname>GtkListItem</classname>s to + populate the list, where only the labels themselves are necessary data. + </simpara> + <para> + <example> + <title>The easy way to fill a GtkCombo's list</title> + <programlisting role="php"> +dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : +"so")); + +function print_this($list, $item) { + $label = $item->child; + echo $label->get()."\n"; + flush(); +} + +$window = &new GtkWindow(); +$window->set_position(GTK_WIN_POS_CENTER); +$window->connect_object("destroy", array("gtk", +"main_quit")); + +$combo = &new GtkCombo(); +$fruit = array('apples', 'bananas', 'cherries', 'damsons', 'eggplants', +'figs', 'grapes'); +$combo->set_popdown_strings($fruit); +/* We don't have handles for these list items, so we connect them through the +GtkList. The child is passed to the callback with the select-child signal. */ +$list = $combo->list; +$list->connect('select-child', 'print_this'); + +$window->add($combo); +$window->show_all(); + +gtk::main(); + </programlisting> + </example> + </para> </desc> </method> @@ -128,13 +394,57 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Prevents return key from opening dropdown list. </shortdesc> <desc> - + <simpara> + Normally the <signalname class="GtkEditable">activate</signalname> + signal is emitted when the return key is pressed and the + <classname>GtkEntry</classname> has keyboard grab. This signal + emission results in the dropdown list being exposed. + </simpara> + <simpara> + <function class="GtkCombo">disable_activate()</function> simply + disconnects the <signalname class="GtkEditable">activate</signalname> + signal when it is set. + </simpara> </desc> </method> </methods> + + <properties> + + <property id="gtk.gtkcombo.property.entry" type="ro"> + <propname>entry</propname> + <proptype><classname>GtkEntry</classname></proptype> + <shortdesc> + Text entry field. + </shortdesc> + <desc> + <simpara> + The <propname class="GtkCombo">entry</propname> property provides + a way of retrieving information directly from the + <classname>GtkEntry</classname> part of the combo widget. + </simpara> + </desc> + </property> + + <property id="gtk.gtkcombo.property.list" type="ro"> + <propname>list</propname> + <proptype><classname>GtkList</classname></proptype> + <shortdesc> + Dropdown list. + </shortdesc> + <desc> + <simpara> + The <propname class="GtkCombo">list</propname> property provides + a way of retrieving information directly from the + <classname>GtkList</classname> part of the combo widget. + </simpara> + </desc> + </property> + + </properties> </classentry> Index: php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml diff -u php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml:1.6 php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml:1.7 --- php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml:1.6 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml Mon Feb 11 21:33:35 2002 @@ -14,8 +14,8 @@ <simpara> The <classname>GtkMenu</classname> currently associated with the option menu pops up in a similar area to that which would be taken up by a - dropdown menu. This is, however, a popup menu; if you need a true - dropdown widget, look at <classname>GtkCombo</classname>. + dropdown menu. This is, however, a popup menu; if you need a dropdown + list widget, take a look at <classname>GtkCombo</classname>. </simpara> </desc> </classmeta> Index: php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml diff -u php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml:1.6 php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml:1.7 --- php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml:1.6 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml Mon Feb 11 21:33:35 2002 @@ -12,13 +12,12 @@ widgets, only one of which may be selected at any one time. </simpara> <simpara> - In the version of GTK+ currently used by PHP-GTK there is an issue with - the <signalname class="GtkWidget">activate</signalname> signal where it - is used alongside toggle switches in arrays. In this particular widget, - the overriding <classname>GtkMenuItem</classname> version of - <signalname class="GtkMenuItem">activate</signalname> is the - activating signal, and as a result of this feature repeats itself when - another group member is activated. + When the <classname>GtkMenuItem</classname> version of the + <signalname class="GtkMenuItem">activate</signalname> signal has been + emitted by a <classname>GtkRadioMenuItem</classname>, there is a second + emission as the most recently active item is toggled to + <literal>inactive</literal>. This is dealt with before the original + signal is handled. </simpara> <simpara> One way around this would be to use the
Index: php-gtk-doc/en/reference/gdk/gdkenum.xml diff -u php-gtk-doc/en/reference/gdk/gdkenum.xml:1.8 php-gtk-doc/en/reference/gdk/gdkenum.xml:1.9 --- php-gtk-doc/en/reference/gdk/gdkenum.xml:1.8 Sat Feb 9 10:27:11 2002 +++ php-gtk-doc/en/reference/gdk/gdkenum.xml Mon Feb 11 21:33:35 2002 @@ -549,10 +549,7 @@ <enum id="gdk.enum.gdkmodifiertype"> <enumname>GdkModifierType</enumname> - <!-- - TODO - get someone who has access to drag and drop to complete the button - modifier details! - number of presses or position of button? - sf Jan 2002 - --> + <enumoption> <optionname>GDK_SHIFT_MASK</optionname> <shortdesc> Index: php-gtk-doc/en/reference/gtk/gtkcombo.xml diff -u php-gtk-doc/en/reference/gtk/gtkcombo.xml:1.4 php-gtk-doc/en/reference/gtk/gtkcombo.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtkcombo.xml:1.4 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkcombo.xml Mon Feb 11 21:33:35 2002 @@ -7,7 +7,106 @@ Text entry field with a dropdown list. </shortdesc> <desc> - + <simpara> + A <classname>GtkCombo</classname> appears to be the equivalent of the + <literal>select</literal> element in HTML. This can be misleading if + you're coming directly from a web development background; a GUI widget + is largely about appearance, and carrying hidden values is not something + this one will do without a little programming. Luckily, there are a trio + of invaluable <classname>GtkObject</classname> methods that will do just + that, with any object and with any form of data. These are + <function class="GtkObject">get_data()</function>, + <function class="GtkObject">set_data()</function> and + <function class="GtkObject">remove_data()</function>. See the sample + under <classname>GtkCombo</classname>'s + <link linkend="gtk.gtkcombo.constructor">constructor</link> to get an + idea of their usage. + </simpara> + <para> + There are a few key bindings in the combo widget. Most of them have + some bearing on searches. + <table> + <title>Key bindings in GtkCombo</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Key combination</entry> + <entry>Function</entry> + </row> + </thead> + <tbody> + <row> + <entry>Return (from the entry box)</entry> + <entry> + Opens up the list. If the entry contains text that fully matches + a list item's content, that list item will be selected on opening. + </entry> + </row> + <row> + <entry>Tab + MOD_1 mask (from the entry box)</entry> + <entry> + The MOD_1 modifier is usually <literal>Alt</literal>. This key + combination auto-completes a partial entry. + </entry> + </row> + <row> + <entry>Arrow up (from the entry box)</entry> + <entry> + If <literal>use_arrows</literal> has been set to + <literal>true</literal>, scrolls up through the list without opening + the list window. Can also be achieved with keypad arrow or + <literal>Alt + p</literal>. + </entry> + </row> + <row> + <entry>Arrow down (from the entry box)</entry> + <entry> + If <literal>use_arrows</literal> has been set to + <literal>true</literal>, scrolls down through the list without + opening the list window. Can also be achieved with keypad arrow + or <literal>Alt + n</literal>. + </entry> + </row> + <row> + <entry>Return (from the list box)</entry> + <entry> + Toggles the list item that has current focus. + </entry> + </row> + <row> + <entry>Spacebar (from the list box)</entry> + <entry> + Selects the list item that has current focus. + </entry> + </row> + <row> + <entry>Up arrow (from the list box)</entry> + <entry> + Scrolls up through the list items. + </entry> + </row> + <row> + <entry>Down arrow (from the list box)</entry> + <entry> + Scrolls down through the list items. + </entry> + </row> + <row> + <entry>Esc (from the list box)</entry> + <entry> + Removes grab from the list box, which closes it. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <simpara> + See also: <classname>GtkEditable</classname>, + <classname>GtkEntry</classname>, <classname>GtkItem</classname>, + <classname>GtkList</classname>, <classname>GtkListItem</classname>, + <classname>GtkOptionMenu</classname>. + </simpara> </desc> </classmeta> @@ -19,10 +118,87 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates an entry box with a dropdown list. </shortdesc> <desc> - + <simpara> + When the <classname>GtkListItem</classname> has been selected in a + <classname>GtkCombo</classname>, the combo's entry text is picked up + from the item, and the combo's list is searched for a data match. The + <signalname class="GtkList">unselect-child</signalname> signal is fired + by the list during this routine in order to clear previously existing + data. If you connect to either that or the + <signalname class="GtkListItem">deselect</signalname> signal, your + callback function will run twice. The same applies to the + <signalname class="GtkList">select-child</signalname> and + <signalname class="GtkListItem">select</signalname> signals, as the + deselection allows the item to be selected again - which it is, when + <function class="GtkList">select_child()</function> is called immediately + afterwards. + </simpara> + <simpara> + There are many ways of working around this. One is given in the sample + below. + </simpara> + <para> + <example> + <title>Associating data with a GtkListItem</title> + <programlisting role="php"> +dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : +"so")); + +function on_click($item, $event, $i) { + echo $item->get_data($i)."\n"; + flush(); +} + +function on_key($item, $i) { + echo $item->get_data($i)."\n"; + flush(); +} + +$window = &new GtkWindow(); +$window->set_position(GTK_WIN_POS_CENTER); +$window->connect_object("destroy", array("gtk", +"main_quit")); + +$combo = &new GtkCombo(); +/* The GtkEntry and GtkList are accessible through the combo's properties */ +$entry = $combo->entry; +$entry->set_text('Choose some fruit'); +$list = $combo->list; +$list->set_selection_mode(GTK_SELECTION_SINGLE); + +$fruit = array('apples', 'bananas', 'cherries', 'damsons', 'eggplants', +'figs', 'grapes'); + +for($i = 0; $i < count($fruit); $i++) { + $item = &new GtkListItem(); +/* You can put pretty much anything into a GtkListItem */ + $box = &new GtkHBox(); + $arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_OUT); + $box->pack_start($arrow, false, false, 5); + $label = &new GtkLabel('Item '.($i+1)); + $box->pack_start($label, false, false, 10); + $item->add($box); + $combo->set_item_string($item, "You chose $fruit[$i]"); + $data = $fruit[$i]; +/* This data will be carried with the $item. The key here is $i. */ + $item->set_data($i, $data); +/* Two separate signals to get around the 'select' problem. */ + $item->connect('button-press-event', 'on_click', $i); + $item->connect('toggle', 'on_key', $i); + $list->add($item); + $item->show_all(); +} + +$window->add($combo); +$window->show_all(); + +gtk::main(); + </programlisting> + </example> + </para> </desc> </constructor> @@ -32,15 +208,20 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_value_in_list</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> - <paramdef>int <parameter>ok_if_empty</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>ok_if_empty</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether entry value must be matched in list. </shortdesc> <desc> - + <simpara> + This method used to make the combo emit a beep if the entry value + could not be matched in the list. It no longer does this, and nor + does it print an error message when the search string is invalid. + Effectively broken. + </simpara> </desc> </method> @@ -48,14 +229,24 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_use_arrows</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether list can be scrolled within entry box. </shortdesc> <desc> - + <simpara> + <function class="GtkCombo">set_use_arrows()</function>, when set to + <literal>false</literal> prevents the <literal>Up</literal> and + <literal>Down</literal> arrow keys from being used to scroll the list + within the combo's entry box. + </simpara> + <simpara> + The default value is <literal>true</literal>, which allows such scrolling + where there is a match between the entry text and one of the list item + strings. + </simpara> </desc> </method> @@ -63,14 +254,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_use_arrows_always</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether entry box list-scrolling should loop. </shortdesc> <desc> - + <simpara> + This method is the adult version of + <function class="GtkCombo">set_use_arrows()</function>. The chief + difference is that the entry box text does not need to match the + text string in a list item in order for the arrows to be used. The + secondary difference is that the scrolling loops back to the start of + the list when the final item is reached, and vice versa. + </simpara> </desc> </method> @@ -78,14 +276,24 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_case_sensitive</function></funcdef> - <paramdef>int <parameter>val</parameter></paramdef> + <paramdef>bool <parameter>val</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether matching should be case-sensitive. </shortdesc> <desc> - + <simpara> + <function class="GtkCombo">set_case_sensitve()</function>, if set + to <literal>true</literal>, will not match items that are dissimilar + with regard to case -in other words, <literal>Cat</literal> is not + the same thing as <literal>cat</literal>. + </simpara> + <simpara> + The default behaviour is that a string in the combo's entry box that is + accurate in all the ways other than case will be altered to match the + list version of that string. + </simpara> </desc> </method> @@ -93,30 +301,88 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_item_string</function></funcdef> - <paramdef><classname>GtkItem</classname> <parameter>item</parameter></paramdef> + <paramdef> + <classname>GtkItem</classname> <parameter>item</parameter> + </paramdef> <paramdef>string <parameter>item_value</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets string associated with list item. </shortdesc> <desc> - + <simpara> + As you may have noticed in the <classname>GtkCombo</classname> + constructor example, it is not by any means essential that the + items in a <classname>GtkList</classname> are + <classname>GtkListItem</classname>s. This method is intended to + provide a way to give an alternative to the entry box, where only + the string data type is allowed. + </simpara> + <simpara> + <function class="GtkCombo">set_item_string()</function> can be set + regardless of whether there is already text in the list item, and + in either case will provide the string that is compared against the + entry's text content during search routines. + </simpara> + <note> + <simpara> + This method determines the string that will be displayed in the + entry field after the list item has been selected. + </simpara> + </note> </desc> </method> <method id="gtk.gtkcombo.method.set_popdown_strings"> <funcsynopsis> <funcprototype> - <funcdef>XXX <function>set_popdown_strings</function></funcdef> - <paramdef>XXX</paramdef> + <funcdef>array <function>set_popdown_strings</function></funcdef> + <paramdef>array item_labels</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Simple list construction. </shortdesc> <desc> - + <simpara> + Use this method to create the <classname>GtkListItem</classname>s to + populate the list, where only the labels themselves are necessary data. + </simpara> + <para> + <example> + <title>The easy way to fill a GtkCombo's list</title> + <programlisting role="php"> +dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : +"so")); + +function print_this($list, $item) { + $label = $item->child; + echo $label->get()."\n"; + flush(); +} + +$window = &new GtkWindow(); +$window->set_position(GTK_WIN_POS_CENTER); +$window->connect_object("destroy", array("gtk", +"main_quit")); + +$combo = &new GtkCombo(); +$fruit = array('apples', 'bananas', 'cherries', 'damsons', 'eggplants', +'figs', 'grapes'); +$combo->set_popdown_strings($fruit); +/* We don't have handles for these list items, so we connect them through the +GtkList. The child is passed to the callback with the select-child signal. */ +$list = $combo->list; +$list->connect('select-child', 'print_this'); + +$window->add($combo); +$window->show_all(); + +gtk::main(); + </programlisting> + </example> + </para> </desc> </method> @@ -128,13 +394,57 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Prevents return key from opening dropdown list. </shortdesc> <desc> - + <simpara> + Normally the <signalname class="GtkEditable">activate</signalname> + signal is emitted when the return key is pressed and the + <classname>GtkEntry</classname> has keyboard grab. This signal + emission results in the dropdown list being exposed. + </simpara> + <simpara> + <function class="GtkCombo">disable_activate()</function> simply + disconnects the <signalname class="GtkEditable">activate</signalname> + signal when it is set. + </simpara> </desc> </method> </methods> + + <properties> + + <property id="gtk.gtkcombo.property.entry" type="ro"> + <propname>entry</propname> + <proptype><classname>GtkEntry</classname></proptype> + <shortdesc> + Text entry field. + </shortdesc> + <desc> + <simpara> + The <propname class="GtkCombo">entry</propname> property provides + a way of retrieving information directly from the + <classname>GtkEntry</classname> part of the combo widget. + </simpara> + </desc> + </property> + + <property id="gtk.gtkcombo.property.list" type="ro"> + <propname>list</propname> + <proptype><classname>GtkList</classname></proptype> + <shortdesc> + Dropdown list. + </shortdesc> + <desc> + <simpara> + The <propname class="GtkCombo">list</propname> property provides + a way of retrieving information directly from the + <classname>GtkList</classname> part of the combo widget. + </simpara> + </desc> + </property> + + </properties> </classentry> Index: php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml diff -u php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml:1.6 php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml:1.7 --- php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml:1.6 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkoptionmenu.xml Mon Feb 11 21:33:35 2002 @@ -14,8 +14,8 @@ <simpara> The <classname>GtkMenu</classname> currently associated with the option menu pops up in a similar area to that which would be taken up by a - dropdown menu. This is, however, a popup menu; if you need a true - dropdown widget, look at <classname>GtkCombo</classname>. + dropdown menu. This is, however, a popup menu; if you need a dropdown + list widget, take a look at <classname>GtkCombo</classname>. </simpara> </desc> </classmeta> Index: php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml diff -u php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml:1.6 php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml:1.7 --- php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml:1.6 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkradiomenuitem.xml Mon Feb 11 21:33:35 2002 @@ -12,13 +12,12 @@ widgets, only one of which may be selected at any one time. </simpara> <simpara> - In the version of GTK+ currently used by PHP-GTK there is an issue with - the <signalname class="GtkWidget">activate</signalname> signal where it - is used alongside toggle switches in arrays. In this particular widget, - the overriding <classname>GtkMenuItem</classname> version of - <signalname class="GtkMenuItem">activate</signalname> is the - activating signal, and as a result of this feature repeats itself when - another group member is activated. + When the <classname>GtkMenuItem</classname> version of the + <signalname class="GtkMenuItem">activate</signalname> signal has been + emitted by a <classname>GtkRadioMenuItem</classname>, there is a second + emission as the most recently active item is toggled to + <literal>inactive</literal>. This is dealt with before the original + signal is handled. </simpara> <simpara> One way around this would be to use the