cvs: php-gtk-doc /en/reference/gtk gtkalignment.xml gtkenum.xml gtkhbox.xml gtkimage.xml gtkitem.xml gtklist.xml gtklistitem.xml gtkvbox.xml
| From: | Steph Fox | Date: | Wed, 27 Feb 2002 00:13:48 +0000 |
| Subject: | cvs: php-gtk-doc /en/reference/gtk gtkalignment.xml gtkenum.xml gtkhbox.xml gtkimage.xml gtkitem.xml gtklist.xml gtklistitem.xml gtkvbox.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-439@lists.php.net to get a copy of this message | ||
sfox Tue Feb 26 19:13:48 2002 EDT
Modified files:
/php-gtk-doc/en/reference/gtk gtkalignment.xml gtkenum.xml
gtkhbox.xml gtkimage.xml gtkitem.xml
gtklist.xml gtklistitem.xml
gtkvbox.xml
Log:
Mostly this is GtkList. And stuff.
Index: php-gtk-doc/en/reference/gtk/gtkalignment.xml diff -u php-gtk-doc/en/reference/gtk/gtkalignment.xml:1.5 php-gtk-doc/en/reference/gtk/gtkalignment.xml:1.6 --- php-gtk-doc/en/reference/gtk/gtkalignment.xml:1.5 Wed Jan 23 01:30:28 2002 +++ php-gtk-doc/en/reference/gtk/gtkalignment.xml Tue Feb 26 19:13:47 2002 @@ -85,11 +85,11 @@ </shortdesc> <desc> <para> - This method sets new values for a <classname>GtkAdjustment</classname>'s + This method sets new values for a <classname>GtkAlignment</classname>'s parameters. <example> <title> - Resetting <classname>GtkAdjustment</classname> parameters. + Resetting <classname>GtkAlignment</classname> parameters. </title> <programlisting role="php"> dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); Index: php-gtk-doc/en/reference/gtk/gtkenum.xml diff -u php-gtk-doc/en/reference/gtk/gtkenum.xml:1.29 php-gtk-doc/en/reference/gtk/gtkenum.xml:1.30 --- php-gtk-doc/en/reference/gtk/gtkenum.xml:1.29 Thu Feb 14 22:26:59 2002 +++ php-gtk-doc/en/reference/gtk/gtkenum.xml Tue Feb 26 19:13:48 2002 @@ -809,6 +809,105 @@ </enum> +<enum id="gtk.enum.gtkscrolltype"> + <enumname>GtkScrollType</enumname> + + <enumoption> + <optionname>GTK_SCROLL_NONE</optionname> + <shortdesc> + The default setting. Indicates that the scrollbar's slider is not moved. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_STEP_BACKWARD</optionname> + <shortdesc> + Sets the scrollbar's slider back one step increment from its current + position. The value of the step increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_STEP_FORWARD</optionname> + <shortdesc> + Sets the scrollbar's slider forward one step increment from its current + position. The value of the step increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_PAGE_BACKWARD</optionname> + <shortdesc> + Sets the scrollbar's slider back one page increment from its current + position. The value of the page increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_PAGE_FORWARD</optionname> + <shortdesc> + Sets the scrollbar's slider forward one page increment from its current + position. The value of the page increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_JUMP</optionname> + <shortdesc> + Sets the scrollbar's slider to the position described in the accompanying + float parameter. The range of values are <literal>0</literal> to + <literal>1</literal>, with the halfway point being <literal>0.5</literal>. + </shortdesc> + </enumoption> + +</enum> + +<enum id="gtk.enum.gtkselectionmode"> + <enumname>GtkSelectionMode</enumname> + + <enumoption> + <optionname>GTK_SELECTION_SINGLE</optionname> + <shortdesc> + Only one item can be selected at any given moment. Other items + can have focus, but will not be marked as selected. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SELECTION_BROWSE</optionname> + <shortdesc> + Only one item can be selected at any given moment. Any item + currently having focus will be marked as selected. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SELECTION_MULTIPLE</optionname> + <shortdesc> + Several items may be selected or unselected with a click or using + the spacebar. They cannot be selected or unselected in any other + way. Note that multiple selection should only be used where all + items share the exact same callback routine. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SELECTION_EXTENDED</optionname> + <shortdesc> + Several items may be selected or unselected using drag, or the shift + (selects all items from the leader to the current focus) or control + (selects the item having current focus) keys. Note that extended + selection should only be used where all items share the exact same + callback routine. + </shortdesc> + </enumoption> + +</enum> + <enum id="gtk.enum.gtkshadowtype"> <enumname>GtkShadowType</enumname> Index: php-gtk-doc/en/reference/gtk/gtkhbox.xml diff -u php-gtk-doc/en/reference/gtk/gtkhbox.xml:1.8 php-gtk-doc/en/reference/gtk/gtkhbox.xml:1.9 --- php-gtk-doc/en/reference/gtk/gtkhbox.xml:1.8 Thu Feb 14 22:26:59 2002 +++ php-gtk-doc/en/reference/gtk/gtkhbox.xml Tue Feb 26 19:13:48 2002 @@ -10,12 +10,13 @@ <simpara> <classname>GtkHBox</classname> is a box container that packs child widgets in a single row, using the packing methods inherited from - <classname>GtkBox</classname>. <classname>GtkHBox</classname> and + <classname>GtkBox</classname>, such as + <function class="GtkBox">pack_start()</function>, as well as the less + flexible <function class="GtkContainer">add()</function> method available + to most container widgets. <classname>GtkHBox</classname> and <classname>GtkVBox</classname> in combination are the most commonly - used packing widgets. See <classname>GtkVBox</classname> for a - working example using both. - <!--TODO This is a temporary measure, example will eventually be in - the userguide but I think we need one available *now*. -sf --> + used packing widgets. See the <classname>GtkVBox</classname> constructor + for a working example using both. </simpara> <simpara> Note that all children in a <classname>GtkHBox</classname> are allocated Index: php-gtk-doc/en/reference/gtk/gtkimage.xml diff -u php-gtk-doc/en/reference/gtk/gtkimage.xml:1.4 php-gtk-doc/en/reference/gtk/gtkimage.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtkimage.xml:1.4 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkimage.xml Tue Feb 26 19:13:48 2002 @@ -7,12 +7,11 @@ Widget for displaying a graphical image. </shortdesc> <desc> - + <simpara> + The <classname>GtkImage</classname> class is not implemented in PHP-GTK. + Use <classname>GtkPixmap</classname> instead. + </simpara> </desc> </classmeta> - - <methods> - - </methods> </classentry> Index: php-gtk-doc/en/reference/gtk/gtkitem.xml diff -u php-gtk-doc/en/reference/gtk/gtkitem.xml:1.7 php-gtk-doc/en/reference/gtk/gtkitem.xml:1.8 --- php-gtk-doc/en/reference/gtk/gtkitem.xml:1.7 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkitem.xml Tue Feb 26 19:13:48 2002 @@ -41,8 +41,8 @@ <desc> <simpara> <function class="GtkItem">select()</function> is part of a - function/signal pair serving as a basis for function/signal pairs - of the same name lower in the hierarchy. + function/signal pair serving as a basis for methods of the same name + lower in the hierarchy. </simpara> <simpara> It enables the relevant implementation of the @@ -64,8 +64,8 @@ <desc> <simpara> <function class="GtkItem">deselect()</function> is part of a - function/signal pair serving as a basis for function/signal pairs - of the same name lower in the hierarchy. + function/signal pair serving as a basis for methods of the same name + lower in the hierarchy. </simpara> <simpara> It enables the relevant implementation of the @@ -86,9 +86,9 @@ </shortdesc> <desc> <simpara> - <function class="GtkItem">toggle()</function> enables the - <signalname class="GtkItem">toggle</signalname> signal to be - emitted programmatically. + <function class="GtkItem">toggle()</function> enables the relevant + implementation of the <literal>toggle</literal> signal to be emitted + programmatically. </simpara> </desc> </method> @@ -114,8 +114,9 @@ emitted when the <function class="GtkItem">select()</function> is called within the program, or when the cursor enters the item's screen area. There is no behaviour defined at base level - for this signal, please see the description relevant to the - non-abstract class you are using for details. + for this signal, please refer to the description in the + <literal>deselect</literal> method in the non-abstract class you are + using. </simpara> </desc> </signal> @@ -137,8 +138,9 @@ emitted when the <function class="GtkItem">deselect()</function> is called within the program, or when the cursor leaves the screen area of the <classname>GtkItem</classname>. There is no behaviour - defined at base level for this signal, please see the description - relevant to the non-abstract class you are using for details. + defined at base level for this signal, please refer to the description + in the <literal>deselect</literal> method in the non-abstract class + you are using. </simpara> </desc> </signal> @@ -165,24 +167,17 @@ </simpara> <simpara> Beyond that, this signal also has no behaviour defined at base - level. In <classname>GtkListItem</classname> the + level. In <classname>GtkListItem</classname> and + <classname>GtkTreeItem</classname>, the <signalname class="GtkItem">toggle</signalname> signal switches states between <enumname>GTK_STATE_SELECTED</enumname> and - <enumname>GTK_STATE_NORMAL</enumname>; these GtkState enumerations + <enumname>GTK_STATE_NORMAL</enumname>; these GtkStateType enumerations are by default colour-coded, providing visual cues for the end user as well as a value within the program. </simpara> <simpara> - In <classname>GtkTreeItem</classname> the - <signalname class="GtkItem">toggle</signalname> signal has a similar - associated function. The difference is that toggling to - <enumname>GTK_STATE_SELECTED</enumname> also sets the - <function class="GtkTree">select_child()</function> method, which in - turn fires <signalname class="GtkTree">selection_changed</signalname>. - </simpara> - <simpara> <classname>GtkMenuItem</classname> inherits the - <signalname class="GtkItem">toggle</signalname> without adding to + <signalname class="GtkItem">toggle</signalname> signal without adding to it, i.e. it is there in theory but has no functionality in practice. </simpara> <note> Index: php-gtk-doc/en/reference/gtk/gtklist.xml diff -u php-gtk-doc/en/reference/gtk/gtklist.xml:1.4 php-gtk-doc/en/reference/gtk/gtklist.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtklist.xml:1.4 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtklist.xml Tue Feb 26 19:13:48 2002 @@ -7,7 +7,31 @@ Widget displaying a list of selectable items. </shortdesc> <desc> - + <simpara> + A <classname>GtkList</classname> is a container widget that is designed + to hold a simple list, the full range of which is displayed. The items + held in the list are selectable, with the default selection mode set as + <literal>GTK_SELECTION_SINGLE</literal>. Each item in the list must be + a <classname>GtkListItem</classname> widget. Glade users will find that + they need to code these manually in order to populate a list or combo box. + </simpara> + <simpara> + The signal part of the function/signal pair for most of the methods given + here is private in <classname>GtkList</classname>, but is also + implemented in <classname>GtkListItem</classname>. As this secondary + implementation is also private, these signals are not covered in this + manual. Although those signals that have GTK keybindings will cause the + appropriate signal to be publicly fired when their key combinations are + used, there is no other way to emit this range of signals. The + keybindings are listed under <classname>GtkListItem</classname>; the + signal prototypes share the relevant <classname>GtkList</classname> + method's parameters, should you need to connect to them. + </simpara> + <simpara> + See also: <classname>GtkCList</classname>, + <classname>GtkCombo</classname>, + <classname>GtkListItem</classname>. + </simpara> </desc> </classmeta> @@ -19,10 +43,72 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates a container for a simple list. </shortdesc> <desc> - + <para> + Creating a <classname>GtkList</classname> widget is straightforward, + populating it slightly less so. Each item added to the list container + <emphasis>must</emphasis> itself be contained in a + <classname>GtkListItem</classname>. In its simplest and most common form, + all that means is that the <classname>GtkListItem</classname> is created + with a label, the text content of which will be displayed in the list. + <example> + <title>Constructing a GtkList</title> + <programlisting role="php"> +dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); + +function echo_it($list, $listitem) { +/* collect the text from the selected list item's label */ + $listlabel = $listitem->child; +/* filter list items according to child object type */ + if($listlabel->get_name() == 'GtkLabel') { + $name = $listlabel->get(); + $label = &new GtkLabel("You chose $name just now"); +/* create a popup window and display a message relevant to selected item */ + $popup = &new GtkWindow(GTK_WINDOW_POPUP); + $popup->set_uposition((gdk::screen_width()/2)+50, +(gdk::screen_height()/3)); + $popup->add($label); + $popup->show_all(); +/* connect the list item's own deselect signal (not the list's) */ + $listitem->connect_object('deselect', create_function('$popup', +'$popup->destroy();'), $popup); + } + else gtk::main_quit(); +} + +$window = &new GtkWindow(GTK_WINDOW_DIALOG); +$window->set_position(GTK_WIN_POS_CENTER); +$window->connect_object('destroy', array('gtk', 'main_quit')); + +$list = &new GtkList(); +/* the contents of this array will populate the list */ +$fill = array('Angela', 'Belinda', 'Carolyn', 'Danike', 'Etha', 'Fiona', +'Gertraud', 'Heidi', 'Jessica', 'Kirstin', 'Lorinda', 'Marianne'); + +foreach(range(0, count($fill)-1) as $i) + $listitem[] = &new GtkListItem($fill[$i]); + +$list->append_items($listitem); + +$enditem = &new GtkListItem(); +/* a list item is also a container */ +$button = &new GtkButton('Close'); +$enditem->add($button); +/* there is no way to append() a single item - but GtkList is a container +widget, so it's okay to use add() */ +$list->add($enditem); +$list->connect('select-child', 'echo_it'); +$list->show_all(); + +$window->add($list); +$window->show_all(); + +gtk::main(); + </programlisting> + </example> + </para> </desc> </constructor> @@ -31,15 +117,18 @@ <method id="gtk.gtklist.method.append_items"> <funcsynopsis> <funcprototype> - <funcdef>XXX <function>append_items</function></funcdef> - <paramdef>XXX</paramdef> + <funcdef>void <function>append_items</function></funcdef> + <paramdef>array</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Appends an array of list items to a list. </shortdesc> <desc> - + <simpara> + This is a widget-specific method for adding an array of + <classname>GtkListItem</classname>s to a <classname>GtkList</classname>. + </simpara> </desc> </method> @@ -52,10 +141,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Clears designated list items from list. </shortdesc> <desc> - + <simpara> + Removes the list items between the positions given in the parameters, + from a <classname>GtkList</classname>. The remaining items close up the + gap, always moving closer to the top as there is no way to fix a child's + list position. Note that the list container itself is not resized to + reflect these changes. + </simpara> </desc> </method> @@ -67,10 +162,21 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkList">select-child</signalname> signal + to be emitted. </shortdesc> <desc> - + <simpara> + The only difference between + <function class="GtkList">select_item()</function> and + <function class="GtkList">select_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">select</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of selection and connection. + </simpara> </desc> </method> @@ -82,10 +188,21 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkList">unselect-child</signalname> signal + to be emitted. </shortdesc> <desc> - + <simpara> + The only difference between + <function class="GtkList">unselect_item()</function> and + <function class="GtkList">unselect_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">deselect</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of de-selection and connection. + </simpara> </desc> </method> @@ -93,14 +210,28 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_child</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>child</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - - </shortdesc> - <desc> - + Causes the <signalname class="GtkList">select-child</signalname> signal + to be emitted. + </shortdesc> + <desc> + <simpara> + The only difference between + <function class="GtkList">select_item()</function> and + <function class="GtkList">select_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">select</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of selection and connection. + </simpara> </desc> </method> @@ -108,14 +239,28 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_child</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>child</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - - </shortdesc> - <desc> - + Causes the <signalname class="GtkList">unselect-child</signalname> signal + to be emitted. + </shortdesc> + <desc> + <simpara> + The only difference between + <function class="GtkList">unselect_item()</function> and + <function class="GtkList">unselect_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">deselect</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of de-selection and connection. + </simpara> </desc> </method> @@ -123,14 +268,22 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>child_position</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>child</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Returns item specified by list position. </shortdesc> <desc> - + <simpara> + <function class="GtkList">child_position()</function> returns the + .list position currently holding the widget that was passed as the + argument. The widget needs to be passed by reference, i.e. using the + form <literal>$widget</literal>. + </simpara> </desc> </method> @@ -138,14 +291,23 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_selection_mode</function></funcdef> - <paramdef><enumname>GtkSelectionMode</enumname> <parameter>mode</parameter></paramdef> + <paramdef> + <enumname>GtkSelectionMode</enumname> + <parameter>mode</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets the selection mode. </shortdesc> <desc> - + <simpara> + Sets one of the four possible <enumname>GtkSelectionMode</enumname> + enumerated values. + </simpara> + <simpara> + The default setting is <literal>GTK_SELECTION_SINGLE</literal>. + </simpara> </desc> </method> @@ -153,16 +315,48 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>extend_selection</function></funcdef> - <paramdef><enumname>GtkScrollType</enumname> <parameter>scroll_type</parameter></paramdef> + <paramdef> + <enumname>GtkScrollType</enumname> + <parameter>scroll_type</parameter> + </paramdef> <paramdef>double <parameter>position</parameter></paramdef> <paramdef>bool <parameter>auto_start_selection</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Extends selected area to position given. </shortdesc> <desc> - + <simpara> + This is quite a complex method that can only be used when the selection + mode is set to <literal>GTK_SELECTION_EXTENDED</literal>. It duplicates + and resets the focus row (i.e. the row that is marked as selected) and + highlights all the items between that and the anchor item. It has + different behaviours depending on whether or not the list has keyboard + grab, so that putting it into a callback function does not have the same + results as calling it from the main loop. + </simpara> + <simpara> + Selection of all the items in the highlighted range requires that + <function class="GtkList">scroll_vertical()</function> is also set + appropriately. + </simpara> + <simpara> + In general, calling the + <function class="GtkList">extend_selection()</function> method + will only select the last row with focus. It needs to have + <function class="GtkList">toggle_add_mode()</function> set in order to + do this when <function class="GtkList">scroll_vertical()</function> is + set after the list widget has grab. + </simpara> + <simpara> + As with <function class="GtkList">scroll_vertical()</function>, this + method's <parameter>position</parameter> parameter is used only when + the <enumname>GtkScrollType</enumname> value is set to + <literal>GTK_SCROLL_JUMP</literal>, and represents a percentage of the + area covered by the scroll. The final parameter negates the method's + functionality completely if set to <literal>false</literal>. + </simpara> </desc> </method> @@ -174,10 +368,27 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Selects range from anchor to currently selected item. </shortdesc> <desc> - + <simpara> + <function class="GtkList">start_selection()</function> selects the range + between the anchor item - <literal>0</literal> on first + opening or the most recent selection thereafter - and the next selection + that is made. For instance, if you were to select item 4 on opening, the + selection range would run as 4, 0, 1, 2, 3. If you then selected item + 7 the new range would be 7, 4, 5, 6. Further items can be included in + the selection by dragging while the mouse button is still pressed down + from selecting the original item. + </simpara> + <simpara> + Note that this method can only be used if the list's selection mode is + set to <literal>GTK_SELECTION_EXTENDED</literal>. + </simpara> + <simpara> + See also: <function class="GtkList">end_selection()</function>, + <function class="GtkList">end_drag_selection()</function>. + </simpara> </desc> </method> @@ -189,10 +400,21 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Curtails selection set with + <function class="GtkList">start_selection()</function>. </shortdesc> <desc> - + <simpara> + <function class="GtkList">end_selection()</function> ends a selection + as it would be if made using + <function class="GtkList">start_selection()</function>. It curtails + the selection so that only the anchor and the item selected return + a <signalname class="GtkListItem">select</signalname> signal. + </simpara> + <simpara> + Note that this method can only be used if the list's selection mode is + set to <literal>GTK_SELECTION_EXTENDED</literal>. + </simpara> </desc> </method> @@ -204,10 +426,15 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Selects all list items. </shortdesc> <desc> - + <simpara> + <function class="GtkList">select_all()</function> selects all the + list items in a <classname>GtkList</classname>. Note that there + needs to be the possibility of multiple selection for this method to + work; see <function class="GtkList">set_selection_mode()</function>. + </simpara> </desc> </method> @@ -219,10 +446,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Deselects all list items. </shortdesc> <desc> - + <simpara> + The corollary to <function class="GtkList">select_all()</function>, this + method can also be used to clear the initial focus when the selection + mode has been set to <literal>GTK_SELECTION_BROWSE</literal>. + </simpara> </desc> </method> @@ -230,15 +461,38 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>scroll_horizontal</function></funcdef> - <paramdef><enumname>GtkScrollType</enumname> <parameter>scroll_type</parameter></paramdef> + <paramdef> + <enumname>GtkScrollType</enumname> + <parameter>scroll_type</parameter> + </paramdef> <paramdef>double <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets associated horizontal scrollbar to a predetermined position. </shortdesc> <desc> - + <simpara> + This method needs + <function class="GtkContainer">set_focus_hadjustment()</function> to be + called on the appropriate scrollbar from the + <classname>GtkList</classname> in order for it to work. It scrolls the + list horizontally to a predetermined position according to the + <enumname>GtkScrollType</enumname>. + </simpara> + <simpara> + The <parameter>position</parameter> parameter is only used where the + enumerated value is <literal>GTK_SCROLL_JUMP</literal>, when + <literal>0.0</literal> sets the scroll to the (default) leftmost point + and <literal>1.0</literal> to the rightmost. Values between + <literal>0.0</literal> and <literal>1.0</literal> describe the + percentage of the distance scrolled, i.e. <literal>0.5</literal> would + set the beginning of the scroll slider halfway across the area. + </simpara> + <simpara> + Where any other <enumname>GtkScrollType</enumname> is set, the + <parameter>position</parameter> is required but is then ignored. + </simpara> </desc> </method> @@ -246,15 +500,41 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>scroll_vertical</function></funcdef> - <paramdef><enumname>GtkScrollType</enumname> <parameter>scroll_type</parameter></paramdef> + <paramdef> + <enumname>GtkScrollType</enumname> + <parameter>scroll_type</parameter> + </paramdef> <paramdef>double <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets associated vertical scrollbar to a predetermined position. </shortdesc> <desc> - + <simpara> + This method needs + <function class="GtkContainer">set_focus_vadjustment()</function> to be + called on the appropriate scrollbar from the + <classname>GtkList</classname> in order for it to work. It scrolls the + list to a predetermined position according to the + <enumname>GtkScrollType</enumname> setting and, if a selection has been + made and the list's selection mode allows it, will automatically select + the child nearest to the new scroll position. + </simpara> + <simpara> + The <parameter>position</parameter> parameter is only used where the + enumerated value is <literal>GTK_SCROLL_JUMP</literal>, when + <literal>0.0</literal> sets the scroll to the topmost item and + <literal>1.0</literal> to the final item. Values between + <literal>0.0</literal> and <literal>1.0</literal> describe the + percentage of the distance scrolled, i.e. <literal>0.5</literal> would + set the scroll so that the last visible item is the one holding the + halfway position in the list. + </simpara> + <simpara> + Where any other <enumname>GtkScrollType</enumname> is set, the + <parameter>position</parameter> is required but is then ignored. + </simpara> </desc> </method> @@ -266,10 +546,22 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether further selections may be added in extended mode. </shortdesc> <desc> - + <simpara> + When <function class="GtkList">toggle_add_mode()</function> has been + called, the grab in a <literal>GTK_SELECTION_EXTENDED</literal> mode + list will remain with the anchor item at the start of the selection, + regardless of where the focus falls, until another item is actually + selected. Effectively it switches the list to something very like + <literal>GTK_SELECTION_BROWSE</literal> mode. + </simpara> + <simpara> + The item that currently has grab has a dashed line around it to signify + its status, as well as the usual <literal>GTK_STATE_SELECTED</literal> + style. + </simpara> </desc> </method> @@ -281,10 +573,18 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Toggles selection status of row with focus. </shortdesc> <desc> - + <simpara> + If the row having current focus is marked as selected, calling + <function class="GtkList">toggle_focus_row()</function> will unselect + it, and vice versa. In both cases the appropriate signal is fired. + </simpara> + <simpara> + This method would be pointless in a list set to + <literal>GTK_SELECTION_BROWSE</literal>, and so is not implemented there. + </simpara> </desc> </method> @@ -292,14 +592,25 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>toggle_row</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>item</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>item</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles selection status of specified row. </shortdesc> <desc> - + <simpara> + If the item specified in the parameter is marked as selected, calling + <function class="GtkList">toggle_row()</function> will unselect + it, and vice versa. In both cases the appropriate signal is fired. + </simpara> + <simpara> + If the selection mode is <literal>GTK_SELECTION_BROWSE</literal>, the + item will always be selected. + </simpara> </desc> </method> @@ -311,10 +622,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + In extended mode, returns selection to its previous state. </shortdesc> <desc> - + <simpara> + This method returns selection to its previous state if the list mode + is set to <literal>GTK_SELECTION_EXTENDED</literal>. It is not + implemented in any other mode. + </simpara> </desc> </method> @@ -326,13 +641,125 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Ends drag selection. </shortdesc> <desc> - + <simpara> + This method is used extensively within GTK to complete a selection. It + removes the grab from the list, and also the internal timer associated + with the drag action. It is unlikely to be very useful at this level. + </simpara> </desc> </method> </methods> + + <signals> + + <signal id="gtk.gtklist.signal.selection-changed"> + <signalname>selection-changed</signalname> + <callback> + <funcprototype> + <funcdef>void <function>callback</function></funcdef> + <paramdef><classname>GtkList</classname> list</paramdef> + </funcprototype> + </callback> + <shortdesc> + Emitted when the selection property is changed. + </shortdesc> + <desc> + <simpara> + The <signalname class="GtkList">selection-changed</signalname> signal + is emitted whenever there is a change in the list's + <propname class="GtkList">selection</propname> property, regardless of + whether that change empties the array. + </simpara> + </desc> + </signal> + + <signal id="gtk.gtklist.signal.select-child"> + <signalname>select-child</signalname> + <callback> + <funcprototype> + <funcdef>void <function>callback</function></funcdef> + <paramdef><classname>GtkList</classname> list</paramdef> + <paramdef><classname>GtkWidget</classname> child</paramdef> + </funcprototype> + </callback> + <shortdesc> + Emitted when a list item is selected. + </shortdesc> + <desc> + <simpara> + The <signalname class="GtkList">select-child</signalname> signal is + emitted when a child is selected. It carries the selected child as + an argument. + </simpara> + <simpara> + This signal is basically a wrapper for the + <signalname class="GtkListItem">select</signalname> signal emitted by + the <classname>GtkListItem</classname> that is currently selected. If + you mix the two, the same item will emit the same signal twice in + response to selection. + </simpara> + </desc> + </signal> + + <signal id="gtk.gtklist.signal.unselect-child"> + <signalname>unselect-child</signalname> + <callback> + <funcprototype> + <funcdef>void <function>callback</function></funcdef> + <paramdef><classname>GtkList</classname> list</paramdef> + <paramdef><classname>GtkWidget</classname> child</paramdef> + </funcprototype> + </callback> + <shortdesc> + Emitted when a list item is deselected. + </shortdesc> + <desc> + <simpara> + The <signalname class="GtkList">unselect-child</signalname> signal is + emitted when a child is deselected. It carries the deselected child as + an argument. + </simpara> + <simpara> + This signal is basically a wrapper for the + <signalname class="GtkListItem">deselect</signalname> signal emitted by + the <classname>GtkListItem</classname> that has just been deselected. If + you mix the two, the same item will emit the same signal twice in + response to deselection. + </simpara> + </desc> + </signal> + +</signals> + + <properties> + + <property id="gtk.gtklist.property.selection" type="ro"> + <propname>selection</propname> + <proptype>array</proptype> + <shortdesc> + Array containing current selection information. + </shortdesc> + <desc> + <simpara> + The <propname class="GtkList">selection</propname> property is an + array that contains any currently selected items. If there is no current + selection, the array will be empty. If the selection mode does not allow + multiple selection, + <programlisting role="php">$list->selection[0];</programlisting> will + return the selected item. If the selection mode allows multiple + selection, there will be as many elements in the array as there are + currently-selected objects. + </simpara> + <simpara> + See also: <function class="GtkContainer">children()</function>. + </simpara> + </desc> + </property> + + </properties> </classentry> Index: php-gtk-doc/en/reference/gtk/gtklistitem.xml diff -u php-gtk-doc/en/reference/gtk/gtklistitem.xml:1.3 php-gtk-doc/en/reference/gtk/gtklistitem.xml:1.4 --- php-gtk-doc/en/reference/gtk/gtklistitem.xml:1.3 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtklistitem.xml Tue Feb 26 19:13:48 2002 @@ -4,10 +4,166 @@ <classtitle>GtkListItem</classtitle> <classparent>GtkItem</classparent> <shortdesc> - + A single element in a <classname>GtkList</classname>. </shortdesc> <desc> - + <simpara> + A <classname>GtkListItem</classname> is one of the elements that makes up + a <classname>GtkList</classname>. It can consist of many things - see + the constructor page - being basically a container with a specialised + set of methods and signals. + </simpara> + <simpara> + <classname>GtkListItem</classname>s are not equipped to carry data, + unless you make it so. Using the <classname>GtkObject</classname> + methods <function class="GtkObject">get_data()</function>, + <function class="GtkObject">remove_data()</function> and + <function class="GtkObject">set_data()</function> is the usual way to + achieve this. See <classname>GtkCombo</classname> for a working example. + </simpara> + <simpara> + The <classname>GtkListItem</classname> class supplies a multitude of + signals to the list widget recursively, where they are treated as private + signals and used internally. Several of these signals have keybindings, + implemented here rather than in <classname>GtkList</classname> of + necessity, which are described below. + </simpara> + <para> + <table> + <title>Key bindings used in <classname>GtkList</classname></title> + <tgroup cols="3"> + <thead> + <row> + <entry>Key combination</entry> + <entry>Effect</entry> + <entry>Equivalent GtkList method</entry> + </row> + </thead> + <tbody> + <row> + <entry>Up arrow</entry> + <entry>Scrolls up one step</entry> + <entry>scroll_vertical(GTK_SCROLL_STEP_BACKWARD, 0.0)</entry> + </row> + <row> + <entry>Down arrow</entry> + <entry>Scrolls down one step</entry> + <entry>scroll_vertical(GTK_SCROLL_STEP_FORWARD, 0.0)</entry> + </row> + <row> + <entry>Page Up</entry> + <entry>Scrolls up one page</entry> + <entry>scroll_vertical(GTK_SCROLL_PAGE_BACKWARD, 0.0)</entry> + </row> + <row> + <entry>Page Down</entry> + <entry>Scrolls down one page</entry> + <entry>scroll_vertical(GTK_SCROLL_PAGE_FORWARD, 0.0)</entry> + </row> + <row> + <entry>Control + Home</entry> + <entry>Scrolls to the top of the list</entry> + <entry>scroll_vertical(GTK_SCROLL_JUMP, 0.0)</entry> + </row> + <row> + <entry>Control + End</entry> + <entry>Scrolls to the end of the list</entry> + <entry>scroll_vertical(GTK_SCROLL_JUMP, 1.0)</entry> + </row> + <row> + <entry>Shift + Up arrow</entry> + <entry>Selects up one step</entry> + <entry>extend_selection(GTK_SCROLL_STEP_BACKWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift + Down arrow</entry> + <entry>Selects down one step</entry> + <entry>extend_selection(GTK_SCROLL_STEP_FORWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift + Page Up</entry> + <entry>Selects up one page</entry> + <entry>extend_selection(GTK_SCROLL_PAGE_BACKWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift + Page Down</entry> + <entry>Selects down one page</entry> + <entry>extend_selection(GTK_SCROLL_PAGE_FORWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift | Control + Home</entry> + <entry>Selects to the top of the list</entry> + <entry>extend_selection(GTK_SCROLL_JUMP, 0.0, true)</entry> + </row> + <row> + <entry>Shift | Control + End</entry> + <entry>Selects to the end of the list</entry> + <entry>extend_selection(GTK_SCROLL_JUMP, 1.0)</entry> + </row> + <row> + <entry>Left arrow</entry> + <entry>Scrolls one step to the left</entry> + <entry>scroll_horizontal(GTK_SCROLL_STEP_BACKWARD, 0.0)</entry> + </row> + <row> + <entry>Right arrow</entry> + <entry>Scrolls one step to the right</entry> + <entry>scroll_horizontal(GTK_SCROLL_STEP_FORWARD, 0.0)</entry> + </row> + <row> + <entry>Home</entry> + <entry>Scrolls to the left of the list</entry> + <entry>scroll_horizontal(GTK_SCROLL_JUMP, 0.0)</entry> + </row> + <row> + <entry>End</entry> + <entry>Scrolls to the right of the list</entry> + <entry>scroll_horizontal(GTK_SCROLL_JUMP, 1.0)</entry> + </row> + <row> + <entry>Escape</entry> + <entry>Returns to previous selection</entry> + <entry>undo_selection()</entry> + </row> + <row> + <entry>Space</entry> + <entry>Toggles state of row with current focus</entry> + <entry>toggle_focus_row()</entry> + </row> + <row> + <entry>Control + Space</entry> + <entry>Toggles whether further items can be selected</entry> + <entry>toggle_add_mode()</entry> + </row> + <row> + <entry>Control + /</entry> + <entry>Selects all items</entry> + <entry>select_all()</entry> + </row> + <row> + <entry>Control + \\</entry> + <entry>Deselects all items</entry> + <entry>unselect_all()</entry> + </row> + <row> + <entry>Shift_L + Release | Shift</entry> + <entry>Completes selection</entry> + <entry>end_selection()</entry> + </row> + <row> + <entry>Shift_R + Release | Shift</entry> + <entry>Completes selection</entry> + <entry>end_selection()</entry> + </row> + <row> + <entry>Shift_R + Release | Shift | Control</entry> + <entry>Completes selection</entry> + <entry>end_selection()</entry> + </row> + </tbody> + </tgroup> + </table> + </para> </desc> </classmeta> @@ -15,14 +171,66 @@ <funcsynopsis> <funcprototype> <funcdef> <function>GtkListItem</function></funcdef> - <paramdef>XXX</paramdef> + <paramdef>string + <parameter><optional>label</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Creates a list element. </shortdesc> <desc> - + <para> + A <classname>GtkListItem</classname> is a container widget, derived + indirectly from <classname>GtkBin</classname> and so only able to hold + one direct child. Most of the time, the child you will want the list + item to contain will be a <classname>GtkLabel</classname> - and so, in + common with all objects that have an alternative + <literal>'-with-label'</literal> constructor available in GTK, we have + the option in PHP-GTK to pass the label's text as a parameter during + construction, e.g. + <informalexample> + <programlisting role="php"> +$listitem = &new GtkListItem("This list item now has a label"); + </programlisting> + </informalexample> + </para> + <para> + If you wanted something other than a label in the list item, you simply + omit the parameter and add the required widget: + <informalexample> + <programlisting role="php"> +$arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); +$listitem = &new GtkListItem(); +$listitem->add($arrow); + </programlisting> + </informalexample> + or, if you wanted perhaps a label plus some other item: + <informalexample> + <programlisting role="php"> +$box = &new GtkHBox(); +$label = &new GtkLabel("Here we have multiple objects in a +GtkListItem"); +$arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); +$box->pack_start($label); +$box->pack_end($arrow); +$box->show_all(); +$listitem = &new GtkListItem(); +$listitem->add($box); + </programlisting> + </informalexample> + </para> + <simpara> + Whatever your list item consists of, the <classname>GtkList</classname> + will only respond to it as a <classname>GtkListItem</classname>. If you + have different kinds of list item contents in the same list, you will + need to exercise a great deal of caution if you are connecting callbacks + to any form of select signal. + </simpara> + <simpara> + See also: <classname>GtkList</classname>, which has a working example + under the constructor. + </simpara> </desc> </constructor> @@ -36,10 +244,32 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkItem">select</signalname> signal to be + emitted. </shortdesc> <desc> - + <simpara> + The <classname>GtkListItem</classname> method + <function class="GtkListItem">select()</function> causes the list item + to emit the <classname>GtkItem</classname> signal + <signalname class="GtkItem">select</signalname>. This is then bound + recursively to the <classname>GtkListItem</classname> implementation of + that signal. + </simpara> + <simpara> + The same sequence of events is produced by calling the + <classname>GtkList</classname> method + <function class="GtkList">select_child()</function>. + </simpara> + <simpara> + The easy part: it sets the <enumname>GtkStateType</enumname> of the + calling list item to <literal>GTK_STATE_SELECTED</literal>. + </simpara> + <simpara> + Note that this state can also be achieved programmatically by calling + <function class="GtkItem">toggle()</function> from a list item that + is currently unselected. + </simpara> </desc> </method> @@ -51,10 +281,32 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkItem">deselect</signalname> signal to + be emitted. </shortdesc> <desc> - + <simpara> + The <classname>GtkListItem</classname> method + <function class="GtkListItem">deselect()</function> causes the list item + to emit the <classname>GtkItem</classname> signal + <signalname class="GtkItem">deselect</signalname>. This is then bound + recursively to the <classname>GtkListItem</classname> implementation of + that signal. + </simpara> + <simpara> + The same sequence of events is produced by calling the + <classname>GtkList</classname> method + <function class="GtkList">unselect_child()</function>. + </simpara> + <simpara> + The easy part: it sets the <enumname>GtkStateType</enumname> of the + calling list item to <literal>GTK_STATE_NORMAL</literal>. + </simpara> + <simpara> + Note that this state can also be achieved programmatically by calling + <function class="GtkItem">toggle()</function> from a list item that + is currently selected. + </simpara> </desc> </method> Index: php-gtk-doc/en/reference/gtk/gtkvbox.xml diff -u php-gtk-doc/en/reference/gtk/gtkvbox.xml:1.8 php-gtk-doc/en/reference/gtk/gtkvbox.xml:1.9 --- php-gtk-doc/en/reference/gtk/gtkvbox.xml:1.8 Thu Feb 14 22:26:59 2002 +++ php-gtk-doc/en/reference/gtk/gtkvbox.xml Tue Feb 26 19:13:48 2002 @@ -10,7 +10,10 @@ <simpara> <classname>GtkVBox</classname> is a box container that packs child widgets in a single column, using the packing methods inherited from - <classname>GtkBox</classname>. + <classname>GtkBox</classname>, such as + <function class="GtkBox">pack_start()</function>, as well as the less + flexible <function class="GtkContainer">add()</function> method available + to most container widgets. </simpara> <simpara> Note that all children in a <classname>GtkVBox</classname> are allocated @@ -18,8 +21,46 @@ Widgets taking up less than the allocated width are by default centered within the available area in that dimension. </simpara> - <!--TODO This is a temporary measure, example will eventually be in - the userguide but I think we need one available *now*. -sf --> + <simpara> + See also: <classname>GtkContainer</classname>, + <classname>GtkBox</classname>, <classname>GtkHBox</classname>, + <classname>GtkButtonBox</classname>, <classname>GtkTable</classname>. + </simpara> + </desc> + </classmeta> + + <constructor id="gtk.gtkvbox.constructor"> + <funcsynopsis> + <funcprototype> + <funcdef> <function>GtkVBox</function></funcdef> + <paramdef>bool + <parameter><optional>homogeneous = false</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>spacing = 0</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <shortdesc> + Creates a container for a single column of child widgets. + </shortdesc> + <desc> + <simpara> + Creates a new vertical box container designed for packing a single + column of child widgets. + </simpara> + <para> + The first parameter, <parameter>homogeneous</parameter>, is a boolean + value which, if set to <literal>true</literal>, will set each child + widget in the <classname>GtkVBox</classname> to the same height as that + of the largest child widget. The second parameter, + <parameter>spacing</parameter>, sets the minimum spacing between the + child widgets, in pixels. Leaving both parameters empty, e.g. + <informalexample> + <programlisting role="php">$vbox = &new GtkVBox();</programlisting> + </informalexample> + will set the default behaviour of individual sizing and zero spacing. + </para> <para> <example> <title>Packing child widgets using <classname>GtkVBox</classname> and @@ -61,46 +102,6 @@ Gtk::main(); </programlisting> </example> - </para> - <simpara> - See also: <classname>GtkContainer</classname>, - <classname>GtkBox</classname>, <classname>GtkHBox</classname>, - <classname>GtkButtonBox</classname>, <classname>GtkTable</classname>. - </simpara> - </desc> - </classmeta> - - <constructor id="gtk.gtkvbox.constructor"> - <funcsynopsis> - <funcprototype> - <funcdef> <function>GtkVBox</function></funcdef> - <paramdef>bool - <parameter><optional>homogeneous = false</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>spacing = 0</optional></parameter> - </paramdef> - </funcprototype> - </funcsynopsis> - <shortdesc> - Creates a container for a single column of child widgets. - </shortdesc> - <desc> - <simpara> - Creates a new vertical box container designed for packing a single - column of child widgets. - </simpara> - <para> - The first parameter, <parameter>homogeneous</parameter>, is a boolean - value which, if set to <literal>true</literal>, will set each child - widget in the <classname>GtkVBox</classname> to the same height as that - of the largest child widget. The second parameter, - <parameter>spacing</parameter>, sets the minimum spacing between the - child widgets, in pixels. Leaving both parameters empty, e.g. - <informalexample> - <programlisting role="php">$vbox = &new GtkVBox();</programlisting> - </informalexample> - will set the default behaviour of individual sizing and zero spacing. </para> </desc> </constructor>
Index: php-gtk-doc/en/reference/gtk/gtkalignment.xml diff -u php-gtk-doc/en/reference/gtk/gtkalignment.xml:1.5 php-gtk-doc/en/reference/gtk/gtkalignment.xml:1.6 --- php-gtk-doc/en/reference/gtk/gtkalignment.xml:1.5 Wed Jan 23 01:30:28 2002 +++ php-gtk-doc/en/reference/gtk/gtkalignment.xml Tue Feb 26 19:13:47 2002 @@ -85,11 +85,11 @@ </shortdesc> <desc> <para> - This method sets new values for a <classname>GtkAdjustment</classname>'s + This method sets new values for a <classname>GtkAlignment</classname>'s parameters. <example> <title> - Resetting <classname>GtkAdjustment</classname> parameters. + Resetting <classname>GtkAlignment</classname> parameters. </title> <programlisting role="php"> dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); Index: php-gtk-doc/en/reference/gtk/gtkenum.xml diff -u php-gtk-doc/en/reference/gtk/gtkenum.xml:1.29 php-gtk-doc/en/reference/gtk/gtkenum.xml:1.30 --- php-gtk-doc/en/reference/gtk/gtkenum.xml:1.29 Thu Feb 14 22:26:59 2002 +++ php-gtk-doc/en/reference/gtk/gtkenum.xml Tue Feb 26 19:13:48 2002 @@ -809,6 +809,105 @@ </enum> +<enum id="gtk.enum.gtkscrolltype"> + <enumname>GtkScrollType</enumname> + + <enumoption> + <optionname>GTK_SCROLL_NONE</optionname> + <shortdesc> + The default setting. Indicates that the scrollbar's slider is not moved. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_STEP_BACKWARD</optionname> + <shortdesc> + Sets the scrollbar's slider back one step increment from its current + position. The value of the step increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_STEP_FORWARD</optionname> + <shortdesc> + Sets the scrollbar's slider forward one step increment from its current + position. The value of the step increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_PAGE_BACKWARD</optionname> + <shortdesc> + Sets the scrollbar's slider back one page increment from its current + position. The value of the page increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_PAGE_FORWARD</optionname> + <shortdesc> + Sets the scrollbar's slider forward one page increment from its current + position. The value of the page increment is taken from the underlying + <classname>GtkAdjustment</classname> in the scrollbar. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SCROLL_JUMP</optionname> + <shortdesc> + Sets the scrollbar's slider to the position described in the accompanying + float parameter. The range of values are <literal>0</literal> to + <literal>1</literal>, with the halfway point being <literal>0.5</literal>. + </shortdesc> + </enumoption> + +</enum> + +<enum id="gtk.enum.gtkselectionmode"> + <enumname>GtkSelectionMode</enumname> + + <enumoption> + <optionname>GTK_SELECTION_SINGLE</optionname> + <shortdesc> + Only one item can be selected at any given moment. Other items + can have focus, but will not be marked as selected. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SELECTION_BROWSE</optionname> + <shortdesc> + Only one item can be selected at any given moment. Any item + currently having focus will be marked as selected. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SELECTION_MULTIPLE</optionname> + <shortdesc> + Several items may be selected or unselected with a click or using + the spacebar. They cannot be selected or unselected in any other + way. Note that multiple selection should only be used where all + items share the exact same callback routine. + </shortdesc> + </enumoption> + + <enumoption> + <optionname>GTK_SELECTION_EXTENDED</optionname> + <shortdesc> + Several items may be selected or unselected using drag, or the shift + (selects all items from the leader to the current focus) or control + (selects the item having current focus) keys. Note that extended + selection should only be used where all items share the exact same + callback routine. + </shortdesc> + </enumoption> + +</enum> + <enum id="gtk.enum.gtkshadowtype"> <enumname>GtkShadowType</enumname> Index: php-gtk-doc/en/reference/gtk/gtkhbox.xml diff -u php-gtk-doc/en/reference/gtk/gtkhbox.xml:1.8 php-gtk-doc/en/reference/gtk/gtkhbox.xml:1.9 --- php-gtk-doc/en/reference/gtk/gtkhbox.xml:1.8 Thu Feb 14 22:26:59 2002 +++ php-gtk-doc/en/reference/gtk/gtkhbox.xml Tue Feb 26 19:13:48 2002 @@ -10,12 +10,13 @@ <simpara> <classname>GtkHBox</classname> is a box container that packs child widgets in a single row, using the packing methods inherited from - <classname>GtkBox</classname>. <classname>GtkHBox</classname> and + <classname>GtkBox</classname>, such as + <function class="GtkBox">pack_start()</function>, as well as the less + flexible <function class="GtkContainer">add()</function> method available + to most container widgets. <classname>GtkHBox</classname> and <classname>GtkVBox</classname> in combination are the most commonly - used packing widgets. See <classname>GtkVBox</classname> for a - working example using both. - <!--TODO This is a temporary measure, example will eventually be in - the userguide but I think we need one available *now*. -sf --> + used packing widgets. See the <classname>GtkVBox</classname> constructor + for a working example using both. </simpara> <simpara> Note that all children in a <classname>GtkHBox</classname> are allocated Index: php-gtk-doc/en/reference/gtk/gtkimage.xml diff -u php-gtk-doc/en/reference/gtk/gtkimage.xml:1.4 php-gtk-doc/en/reference/gtk/gtkimage.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtkimage.xml:1.4 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkimage.xml Tue Feb 26 19:13:48 2002 @@ -7,12 +7,11 @@ Widget for displaying a graphical image. </shortdesc> <desc> - + <simpara> + The <classname>GtkImage</classname> class is not implemented in PHP-GTK. + Use <classname>GtkPixmap</classname> instead. + </simpara> </desc> </classmeta> - - <methods> - - </methods> </classentry> Index: php-gtk-doc/en/reference/gtk/gtkitem.xml diff -u php-gtk-doc/en/reference/gtk/gtkitem.xml:1.7 php-gtk-doc/en/reference/gtk/gtkitem.xml:1.8 --- php-gtk-doc/en/reference/gtk/gtkitem.xml:1.7 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtkitem.xml Tue Feb 26 19:13:48 2002 @@ -41,8 +41,8 @@ <desc> <simpara> <function class="GtkItem">select()</function> is part of a - function/signal pair serving as a basis for function/signal pairs - of the same name lower in the hierarchy. + function/signal pair serving as a basis for methods of the same name + lower in the hierarchy. </simpara> <simpara> It enables the relevant implementation of the @@ -64,8 +64,8 @@ <desc> <simpara> <function class="GtkItem">deselect()</function> is part of a - function/signal pair serving as a basis for function/signal pairs - of the same name lower in the hierarchy. + function/signal pair serving as a basis for methods of the same name + lower in the hierarchy. </simpara> <simpara> It enables the relevant implementation of the @@ -86,9 +86,9 @@ </shortdesc> <desc> <simpara> - <function class="GtkItem">toggle()</function> enables the - <signalname class="GtkItem">toggle</signalname> signal to be - emitted programmatically. + <function class="GtkItem">toggle()</function> enables the relevant + implementation of the <literal>toggle</literal> signal to be emitted + programmatically. </simpara> </desc> </method> @@ -114,8 +114,9 @@ emitted when the <function class="GtkItem">select()</function> is called within the program, or when the cursor enters the item's screen area. There is no behaviour defined at base level - for this signal, please see the description relevant to the - non-abstract class you are using for details. + for this signal, please refer to the description in the + <literal>deselect</literal> method in the non-abstract class you are + using. </simpara> </desc> </signal> @@ -137,8 +138,9 @@ emitted when the <function class="GtkItem">deselect()</function> is called within the program, or when the cursor leaves the screen area of the <classname>GtkItem</classname>. There is no behaviour - defined at base level for this signal, please see the description - relevant to the non-abstract class you are using for details. + defined at base level for this signal, please refer to the description + in the <literal>deselect</literal> method in the non-abstract class + you are using. </simpara> </desc> </signal> @@ -165,24 +167,17 @@ </simpara> <simpara> Beyond that, this signal also has no behaviour defined at base - level. In <classname>GtkListItem</classname> the + level. In <classname>GtkListItem</classname> and + <classname>GtkTreeItem</classname>, the <signalname class="GtkItem">toggle</signalname> signal switches states between <enumname>GTK_STATE_SELECTED</enumname> and - <enumname>GTK_STATE_NORMAL</enumname>; these GtkState enumerations + <enumname>GTK_STATE_NORMAL</enumname>; these GtkStateType enumerations are by default colour-coded, providing visual cues for the end user as well as a value within the program. </simpara> <simpara> - In <classname>GtkTreeItem</classname> the - <signalname class="GtkItem">toggle</signalname> signal has a similar - associated function. The difference is that toggling to - <enumname>GTK_STATE_SELECTED</enumname> also sets the - <function class="GtkTree">select_child()</function> method, which in - turn fires <signalname class="GtkTree">selection_changed</signalname>. - </simpara> - <simpara> <classname>GtkMenuItem</classname> inherits the - <signalname class="GtkItem">toggle</signalname> without adding to + <signalname class="GtkItem">toggle</signalname> signal without adding to it, i.e. it is there in theory but has no functionality in practice. </simpara> <note> Index: php-gtk-doc/en/reference/gtk/gtklist.xml diff -u php-gtk-doc/en/reference/gtk/gtklist.xml:1.4 php-gtk-doc/en/reference/gtk/gtklist.xml:1.5 --- php-gtk-doc/en/reference/gtk/gtklist.xml:1.4 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtklist.xml Tue Feb 26 19:13:48 2002 @@ -7,7 +7,31 @@ Widget displaying a list of selectable items. </shortdesc> <desc> - + <simpara> + A <classname>GtkList</classname> is a container widget that is designed + to hold a simple list, the full range of which is displayed. The items + held in the list are selectable, with the default selection mode set as + <literal>GTK_SELECTION_SINGLE</literal>. Each item in the list must be + a <classname>GtkListItem</classname> widget. Glade users will find that + they need to code these manually in order to populate a list or combo box. + </simpara> + <simpara> + The signal part of the function/signal pair for most of the methods given + here is private in <classname>GtkList</classname>, but is also + implemented in <classname>GtkListItem</classname>. As this secondary + implementation is also private, these signals are not covered in this + manual. Although those signals that have GTK keybindings will cause the + appropriate signal to be publicly fired when their key combinations are + used, there is no other way to emit this range of signals. The + keybindings are listed under <classname>GtkListItem</classname>; the + signal prototypes share the relevant <classname>GtkList</classname> + method's parameters, should you need to connect to them. + </simpara> + <simpara> + See also: <classname>GtkCList</classname>, + <classname>GtkCombo</classname>, + <classname>GtkListItem</classname>. + </simpara> </desc> </classmeta> @@ -19,10 +43,72 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Creates a container for a simple list. </shortdesc> <desc> - + <para> + Creating a <classname>GtkList</classname> widget is straightforward, + populating it slightly less so. Each item added to the list container + <emphasis>must</emphasis> itself be contained in a + <classname>GtkListItem</classname>. In its simplest and most common form, + all that means is that the <classname>GtkListItem</classname> is created + with a label, the text content of which will be displayed in the list. + <example> + <title>Constructing a GtkList</title> + <programlisting role="php"> +dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); + +function echo_it($list, $listitem) { +/* collect the text from the selected list item's label */ + $listlabel = $listitem->child; +/* filter list items according to child object type */ + if($listlabel->get_name() == 'GtkLabel') { + $name = $listlabel->get(); + $label = &new GtkLabel("You chose $name just now"); +/* create a popup window and display a message relevant to selected item */ + $popup = &new GtkWindow(GTK_WINDOW_POPUP); + $popup->set_uposition((gdk::screen_width()/2)+50, +(gdk::screen_height()/3)); + $popup->add($label); + $popup->show_all(); +/* connect the list item's own deselect signal (not the list's) */ + $listitem->connect_object('deselect', create_function('$popup', +'$popup->destroy();'), $popup); + } + else gtk::main_quit(); +} + +$window = &new GtkWindow(GTK_WINDOW_DIALOG); +$window->set_position(GTK_WIN_POS_CENTER); +$window->connect_object('destroy', array('gtk', 'main_quit')); + +$list = &new GtkList(); +/* the contents of this array will populate the list */ +$fill = array('Angela', 'Belinda', 'Carolyn', 'Danike', 'Etha', 'Fiona', +'Gertraud', 'Heidi', 'Jessica', 'Kirstin', 'Lorinda', 'Marianne'); + +foreach(range(0, count($fill)-1) as $i) + $listitem[] = &new GtkListItem($fill[$i]); + +$list->append_items($listitem); + +$enditem = &new GtkListItem(); +/* a list item is also a container */ +$button = &new GtkButton('Close'); +$enditem->add($button); +/* there is no way to append() a single item - but GtkList is a container +widget, so it's okay to use add() */ +$list->add($enditem); +$list->connect('select-child', 'echo_it'); +$list->show_all(); + +$window->add($list); +$window->show_all(); + +gtk::main(); + </programlisting> + </example> + </para> </desc> </constructor> @@ -31,15 +117,18 @@ <method id="gtk.gtklist.method.append_items"> <funcsynopsis> <funcprototype> - <funcdef>XXX <function>append_items</function></funcdef> - <paramdef>XXX</paramdef> + <funcdef>void <function>append_items</function></funcdef> + <paramdef>array</paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Appends an array of list items to a list. </shortdesc> <desc> - + <simpara> + This is a widget-specific method for adding an array of + <classname>GtkListItem</classname>s to a <classname>GtkList</classname>. + </simpara> </desc> </method> @@ -52,10 +141,16 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Clears designated list items from list. </shortdesc> <desc> - + <simpara> + Removes the list items between the positions given in the parameters, + from a <classname>GtkList</classname>. The remaining items close up the + gap, always moving closer to the top as there is no way to fix a child's + list position. Note that the list container itself is not resized to + reflect these changes. + </simpara> </desc> </method> @@ -67,10 +162,21 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkList">select-child</signalname> signal + to be emitted. </shortdesc> <desc> - + <simpara> + The only difference between + <function class="GtkList">select_item()</function> and + <function class="GtkList">select_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">select</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of selection and connection. + </simpara> </desc> </method> @@ -82,10 +188,21 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkList">unselect-child</signalname> signal + to be emitted. </shortdesc> <desc> - + <simpara> + The only difference between + <function class="GtkList">unselect_item()</function> and + <function class="GtkList">unselect_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">deselect</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of de-selection and connection. + </simpara> </desc> </method> @@ -93,14 +210,28 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>select_child</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>child</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - - </shortdesc> - <desc> - + Causes the <signalname class="GtkList">select-child</signalname> signal + to be emitted. + </shortdesc> + <desc> + <simpara> + The only difference between + <function class="GtkList">select_item()</function> and + <function class="GtkList">select_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">select</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of selection and connection. + </simpara> </desc> </method> @@ -108,14 +239,28 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>unselect_child</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>child</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - - </shortdesc> - <desc> - + Causes the <signalname class="GtkList">unselect-child</signalname> signal + to be emitted. + </shortdesc> + <desc> + <simpara> + The only difference between + <function class="GtkList">unselect_item()</function> and + <function class="GtkList">unselect_child()</function> is that the former + takes the item's list position as a parameter rather than the + <classname>GtkListItem</classname> object itself. In either case, the + signal that is actually emitted is the list item's + <signalname class="GtkListItem">deselect</signalname> signal - these are + just different ways of describing the same thing, providing alternative + means of de-selection and connection. + </simpara> </desc> </method> @@ -123,14 +268,22 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>child_position</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>child</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>child</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Returns item specified by list position. </shortdesc> <desc> - + <simpara> + <function class="GtkList">child_position()</function> returns the + .list position currently holding the widget that was passed as the + argument. The widget needs to be passed by reference, i.e. using the + form <literal>$widget</literal>. + </simpara> </desc> </method> @@ -138,14 +291,23 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>set_selection_mode</function></funcdef> - <paramdef><enumname>GtkSelectionMode</enumname> <parameter>mode</parameter></paramdef> + <paramdef> + <enumname>GtkSelectionMode</enumname> + <parameter>mode</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets the selection mode. </shortdesc> <desc> - + <simpara> + Sets one of the four possible <enumname>GtkSelectionMode</enumname> + enumerated values. + </simpara> + <simpara> + The default setting is <literal>GTK_SELECTION_SINGLE</literal>. + </simpara> </desc> </method> @@ -153,16 +315,48 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>extend_selection</function></funcdef> - <paramdef><enumname>GtkScrollType</enumname> <parameter>scroll_type</parameter></paramdef> + <paramdef> + <enumname>GtkScrollType</enumname> + <parameter>scroll_type</parameter> + </paramdef> <paramdef>double <parameter>position</parameter></paramdef> <paramdef>bool <parameter>auto_start_selection</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Extends selected area to position given. </shortdesc> <desc> - + <simpara> + This is quite a complex method that can only be used when the selection + mode is set to <literal>GTK_SELECTION_EXTENDED</literal>. It duplicates + and resets the focus row (i.e. the row that is marked as selected) and + highlights all the items between that and the anchor item. It has + different behaviours depending on whether or not the list has keyboard + grab, so that putting it into a callback function does not have the same + results as calling it from the main loop. + </simpara> + <simpara> + Selection of all the items in the highlighted range requires that + <function class="GtkList">scroll_vertical()</function> is also set + appropriately. + </simpara> + <simpara> + In general, calling the + <function class="GtkList">extend_selection()</function> method + will only select the last row with focus. It needs to have + <function class="GtkList">toggle_add_mode()</function> set in order to + do this when <function class="GtkList">scroll_vertical()</function> is + set after the list widget has grab. + </simpara> + <simpara> + As with <function class="GtkList">scroll_vertical()</function>, this + method's <parameter>position</parameter> parameter is used only when + the <enumname>GtkScrollType</enumname> value is set to + <literal>GTK_SCROLL_JUMP</literal>, and represents a percentage of the + area covered by the scroll. The final parameter negates the method's + functionality completely if set to <literal>false</literal>. + </simpara> </desc> </method> @@ -174,10 +368,27 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Selects range from anchor to currently selected item. </shortdesc> <desc> - + <simpara> + <function class="GtkList">start_selection()</function> selects the range + between the anchor item - <literal>0</literal> on first + opening or the most recent selection thereafter - and the next selection + that is made. For instance, if you were to select item 4 on opening, the + selection range would run as 4, 0, 1, 2, 3. If you then selected item + 7 the new range would be 7, 4, 5, 6. Further items can be included in + the selection by dragging while the mouse button is still pressed down + from selecting the original item. + </simpara> + <simpara> + Note that this method can only be used if the list's selection mode is + set to <literal>GTK_SELECTION_EXTENDED</literal>. + </simpara> + <simpara> + See also: <function class="GtkList">end_selection()</function>, + <function class="GtkList">end_drag_selection()</function>. + </simpara> </desc> </method> @@ -189,10 +400,21 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Curtails selection set with + <function class="GtkList">start_selection()</function>. </shortdesc> <desc> - + <simpara> + <function class="GtkList">end_selection()</function> ends a selection + as it would be if made using + <function class="GtkList">start_selection()</function>. It curtails + the selection so that only the anchor and the item selected return + a <signalname class="GtkListItem">select</signalname> signal. + </simpara> + <simpara> + Note that this method can only be used if the list's selection mode is + set to <literal>GTK_SELECTION_EXTENDED</literal>. + </simpara> </desc> </method> @@ -204,10 +426,15 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Selects all list items. </shortdesc> <desc> - + <simpara> + <function class="GtkList">select_all()</function> selects all the + list items in a <classname>GtkList</classname>. Note that there + needs to be the possibility of multiple selection for this method to + work; see <function class="GtkList">set_selection_mode()</function>. + </simpara> </desc> </method> @@ -219,10 +446,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Deselects all list items. </shortdesc> <desc> - + <simpara> + The corollary to <function class="GtkList">select_all()</function>, this + method can also be used to clear the initial focus when the selection + mode has been set to <literal>GTK_SELECTION_BROWSE</literal>. + </simpara> </desc> </method> @@ -230,15 +461,38 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>scroll_horizontal</function></funcdef> - <paramdef><enumname>GtkScrollType</enumname> <parameter>scroll_type</parameter></paramdef> + <paramdef> + <enumname>GtkScrollType</enumname> + <parameter>scroll_type</parameter> + </paramdef> <paramdef>double <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets associated horizontal scrollbar to a predetermined position. </shortdesc> <desc> - + <simpara> + This method needs + <function class="GtkContainer">set_focus_hadjustment()</function> to be + called on the appropriate scrollbar from the + <classname>GtkList</classname> in order for it to work. It scrolls the + list horizontally to a predetermined position according to the + <enumname>GtkScrollType</enumname>. + </simpara> + <simpara> + The <parameter>position</parameter> parameter is only used where the + enumerated value is <literal>GTK_SCROLL_JUMP</literal>, when + <literal>0.0</literal> sets the scroll to the (default) leftmost point + and <literal>1.0</literal> to the rightmost. Values between + <literal>0.0</literal> and <literal>1.0</literal> describe the + percentage of the distance scrolled, i.e. <literal>0.5</literal> would + set the beginning of the scroll slider halfway across the area. + </simpara> + <simpara> + Where any other <enumname>GtkScrollType</enumname> is set, the + <parameter>position</parameter> is required but is then ignored. + </simpara> </desc> </method> @@ -246,15 +500,41 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>scroll_vertical</function></funcdef> - <paramdef><enumname>GtkScrollType</enumname> <parameter>scroll_type</parameter></paramdef> + <paramdef> + <enumname>GtkScrollType</enumname> + <parameter>scroll_type</parameter> + </paramdef> <paramdef>double <parameter>position</parameter></paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Sets associated vertical scrollbar to a predetermined position. </shortdesc> <desc> - + <simpara> + This method needs + <function class="GtkContainer">set_focus_vadjustment()</function> to be + called on the appropriate scrollbar from the + <classname>GtkList</classname> in order for it to work. It scrolls the + list to a predetermined position according to the + <enumname>GtkScrollType</enumname> setting and, if a selection has been + made and the list's selection mode allows it, will automatically select + the child nearest to the new scroll position. + </simpara> + <simpara> + The <parameter>position</parameter> parameter is only used where the + enumerated value is <literal>GTK_SCROLL_JUMP</literal>, when + <literal>0.0</literal> sets the scroll to the topmost item and + <literal>1.0</literal> to the final item. Values between + <literal>0.0</literal> and <literal>1.0</literal> describe the + percentage of the distance scrolled, i.e. <literal>0.5</literal> would + set the scroll so that the last visible item is the one holding the + halfway position in the list. + </simpara> + <simpara> + Where any other <enumname>GtkScrollType</enumname> is set, the + <parameter>position</parameter> is required but is then ignored. + </simpara> </desc> </method> @@ -266,10 +546,22 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Toggles whether further selections may be added in extended mode. </shortdesc> <desc> - + <simpara> + When <function class="GtkList">toggle_add_mode()</function> has been + called, the grab in a <literal>GTK_SELECTION_EXTENDED</literal> mode + list will remain with the anchor item at the start of the selection, + regardless of where the focus falls, until another item is actually + selected. Effectively it switches the list to something very like + <literal>GTK_SELECTION_BROWSE</literal> mode. + </simpara> + <simpara> + The item that currently has grab has a dashed line around it to signify + its status, as well as the usual <literal>GTK_STATE_SELECTED</literal> + style. + </simpara> </desc> </method> @@ -281,10 +573,18 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Toggles selection status of row with focus. </shortdesc> <desc> - + <simpara> + If the row having current focus is marked as selected, calling + <function class="GtkList">toggle_focus_row()</function> will unselect + it, and vice versa. In both cases the appropriate signal is fired. + </simpara> + <simpara> + This method would be pointless in a list set to + <literal>GTK_SELECTION_BROWSE</literal>, and so is not implemented there. + </simpara> </desc> </method> @@ -292,14 +592,25 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>toggle_row</function></funcdef> - <paramdef><classname>GtkWidget</classname> <parameter>item</parameter></paramdef> + <paramdef> + <classname>GtkWidget</classname> + <parameter>item</parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Toggles selection status of specified row. </shortdesc> <desc> - + <simpara> + If the item specified in the parameter is marked as selected, calling + <function class="GtkList">toggle_row()</function> will unselect + it, and vice versa. In both cases the appropriate signal is fired. + </simpara> + <simpara> + If the selection mode is <literal>GTK_SELECTION_BROWSE</literal>, the + item will always be selected. + </simpara> </desc> </method> @@ -311,10 +622,14 @@ </funcprototype> </funcsynopsis> <shortdesc> - + In extended mode, returns selection to its previous state. </shortdesc> <desc> - + <simpara> + This method returns selection to its previous state if the list mode + is set to <literal>GTK_SELECTION_EXTENDED</literal>. It is not + implemented in any other mode. + </simpara> </desc> </method> @@ -326,13 +641,125 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Ends drag selection. </shortdesc> <desc> - + <simpara> + This method is used extensively within GTK to complete a selection. It + removes the grab from the list, and also the internal timer associated + with the drag action. It is unlikely to be very useful at this level. + </simpara> </desc> </method> </methods> + + <signals> + + <signal id="gtk.gtklist.signal.selection-changed"> + <signalname>selection-changed</signalname> + <callback> + <funcprototype> + <funcdef>void <function>callback</function></funcdef> + <paramdef><classname>GtkList</classname> list</paramdef> + </funcprototype> + </callback> + <shortdesc> + Emitted when the selection property is changed. + </shortdesc> + <desc> + <simpara> + The <signalname class="GtkList">selection-changed</signalname> signal + is emitted whenever there is a change in the list's + <propname class="GtkList">selection</propname> property, regardless of + whether that change empties the array. + </simpara> + </desc> + </signal> + + <signal id="gtk.gtklist.signal.select-child"> + <signalname>select-child</signalname> + <callback> + <funcprototype> + <funcdef>void <function>callback</function></funcdef> + <paramdef><classname>GtkList</classname> list</paramdef> + <paramdef><classname>GtkWidget</classname> child</paramdef> + </funcprototype> + </callback> + <shortdesc> + Emitted when a list item is selected. + </shortdesc> + <desc> + <simpara> + The <signalname class="GtkList">select-child</signalname> signal is + emitted when a child is selected. It carries the selected child as + an argument. + </simpara> + <simpara> + This signal is basically a wrapper for the + <signalname class="GtkListItem">select</signalname> signal emitted by + the <classname>GtkListItem</classname> that is currently selected. If + you mix the two, the same item will emit the same signal twice in + response to selection. + </simpara> + </desc> + </signal> + + <signal id="gtk.gtklist.signal.unselect-child"> + <signalname>unselect-child</signalname> + <callback> + <funcprototype> + <funcdef>void <function>callback</function></funcdef> + <paramdef><classname>GtkList</classname> list</paramdef> + <paramdef><classname>GtkWidget</classname> child</paramdef> + </funcprototype> + </callback> + <shortdesc> + Emitted when a list item is deselected. + </shortdesc> + <desc> + <simpara> + The <signalname class="GtkList">unselect-child</signalname> signal is + emitted when a child is deselected. It carries the deselected child as + an argument. + </simpara> + <simpara> + This signal is basically a wrapper for the + <signalname class="GtkListItem">deselect</signalname> signal emitted by + the <classname>GtkListItem</classname> that has just been deselected. If + you mix the two, the same item will emit the same signal twice in + response to deselection. + </simpara> + </desc> + </signal> + +</signals> + + <properties> + + <property id="gtk.gtklist.property.selection" type="ro"> + <propname>selection</propname> + <proptype>array</proptype> + <shortdesc> + Array containing current selection information. + </shortdesc> + <desc> + <simpara> + The <propname class="GtkList">selection</propname> property is an + array that contains any currently selected items. If there is no current + selection, the array will be empty. If the selection mode does not allow + multiple selection, + <programlisting role="php">$list->selection[0];</programlisting> will + return the selected item. If the selection mode allows multiple + selection, there will be as many elements in the array as there are + currently-selected objects. + </simpara> + <simpara> + See also: <function class="GtkContainer">children()</function>. + </simpara> + </desc> + </property> + + </properties> </classentry> Index: php-gtk-doc/en/reference/gtk/gtklistitem.xml diff -u php-gtk-doc/en/reference/gtk/gtklistitem.xml:1.3 php-gtk-doc/en/reference/gtk/gtklistitem.xml:1.4 --- php-gtk-doc/en/reference/gtk/gtklistitem.xml:1.3 Sun Jan 20 14:47:43 2002 +++ php-gtk-doc/en/reference/gtk/gtklistitem.xml Tue Feb 26 19:13:48 2002 @@ -4,10 +4,166 @@ <classtitle>GtkListItem</classtitle> <classparent>GtkItem</classparent> <shortdesc> - + A single element in a <classname>GtkList</classname>. </shortdesc> <desc> - + <simpara> + A <classname>GtkListItem</classname> is one of the elements that makes up + a <classname>GtkList</classname>. It can consist of many things - see + the constructor page - being basically a container with a specialised + set of methods and signals. + </simpara> + <simpara> + <classname>GtkListItem</classname>s are not equipped to carry data, + unless you make it so. Using the <classname>GtkObject</classname> + methods <function class="GtkObject">get_data()</function>, + <function class="GtkObject">remove_data()</function> and + <function class="GtkObject">set_data()</function> is the usual way to + achieve this. See <classname>GtkCombo</classname> for a working example. + </simpara> + <simpara> + The <classname>GtkListItem</classname> class supplies a multitude of + signals to the list widget recursively, where they are treated as private + signals and used internally. Several of these signals have keybindings, + implemented here rather than in <classname>GtkList</classname> of + necessity, which are described below. + </simpara> + <para> + <table> + <title>Key bindings used in <classname>GtkList</classname></title> + <tgroup cols="3"> + <thead> + <row> + <entry>Key combination</entry> + <entry>Effect</entry> + <entry>Equivalent GtkList method</entry> + </row> + </thead> + <tbody> + <row> + <entry>Up arrow</entry> + <entry>Scrolls up one step</entry> + <entry>scroll_vertical(GTK_SCROLL_STEP_BACKWARD, 0.0)</entry> + </row> + <row> + <entry>Down arrow</entry> + <entry>Scrolls down one step</entry> + <entry>scroll_vertical(GTK_SCROLL_STEP_FORWARD, 0.0)</entry> + </row> + <row> + <entry>Page Up</entry> + <entry>Scrolls up one page</entry> + <entry>scroll_vertical(GTK_SCROLL_PAGE_BACKWARD, 0.0)</entry> + </row> + <row> + <entry>Page Down</entry> + <entry>Scrolls down one page</entry> + <entry>scroll_vertical(GTK_SCROLL_PAGE_FORWARD, 0.0)</entry> + </row> + <row> + <entry>Control + Home</entry> + <entry>Scrolls to the top of the list</entry> + <entry>scroll_vertical(GTK_SCROLL_JUMP, 0.0)</entry> + </row> + <row> + <entry>Control + End</entry> + <entry>Scrolls to the end of the list</entry> + <entry>scroll_vertical(GTK_SCROLL_JUMP, 1.0)</entry> + </row> + <row> + <entry>Shift + Up arrow</entry> + <entry>Selects up one step</entry> + <entry>extend_selection(GTK_SCROLL_STEP_BACKWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift + Down arrow</entry> + <entry>Selects down one step</entry> + <entry>extend_selection(GTK_SCROLL_STEP_FORWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift + Page Up</entry> + <entry>Selects up one page</entry> + <entry>extend_selection(GTK_SCROLL_PAGE_BACKWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift + Page Down</entry> + <entry>Selects down one page</entry> + <entry>extend_selection(GTK_SCROLL_PAGE_FORWARD, 0.0, true)</entry> + </row> + <row> + <entry>Shift | Control + Home</entry> + <entry>Selects to the top of the list</entry> + <entry>extend_selection(GTK_SCROLL_JUMP, 0.0, true)</entry> + </row> + <row> + <entry>Shift | Control + End</entry> + <entry>Selects to the end of the list</entry> + <entry>extend_selection(GTK_SCROLL_JUMP, 1.0)</entry> + </row> + <row> + <entry>Left arrow</entry> + <entry>Scrolls one step to the left</entry> + <entry>scroll_horizontal(GTK_SCROLL_STEP_BACKWARD, 0.0)</entry> + </row> + <row> + <entry>Right arrow</entry> + <entry>Scrolls one step to the right</entry> + <entry>scroll_horizontal(GTK_SCROLL_STEP_FORWARD, 0.0)</entry> + </row> + <row> + <entry>Home</entry> + <entry>Scrolls to the left of the list</entry> + <entry>scroll_horizontal(GTK_SCROLL_JUMP, 0.0)</entry> + </row> + <row> + <entry>End</entry> + <entry>Scrolls to the right of the list</entry> + <entry>scroll_horizontal(GTK_SCROLL_JUMP, 1.0)</entry> + </row> + <row> + <entry>Escape</entry> + <entry>Returns to previous selection</entry> + <entry>undo_selection()</entry> + </row> + <row> + <entry>Space</entry> + <entry>Toggles state of row with current focus</entry> + <entry>toggle_focus_row()</entry> + </row> + <row> + <entry>Control + Space</entry> + <entry>Toggles whether further items can be selected</entry> + <entry>toggle_add_mode()</entry> + </row> + <row> + <entry>Control + /</entry> + <entry>Selects all items</entry> + <entry>select_all()</entry> + </row> + <row> + <entry>Control + \\</entry> + <entry>Deselects all items</entry> + <entry>unselect_all()</entry> + </row> + <row> + <entry>Shift_L + Release | Shift</entry> + <entry>Completes selection</entry> + <entry>end_selection()</entry> + </row> + <row> + <entry>Shift_R + Release | Shift</entry> + <entry>Completes selection</entry> + <entry>end_selection()</entry> + </row> + <row> + <entry>Shift_R + Release | Shift | Control</entry> + <entry>Completes selection</entry> + <entry>end_selection()</entry> + </row> + </tbody> + </tgroup> + </table> + </para> </desc> </classmeta> @@ -15,14 +171,66 @@ <funcsynopsis> <funcprototype> <funcdef> <function>GtkListItem</function></funcdef> - <paramdef>XXX</paramdef> + <paramdef>string + <parameter><optional>label</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <shortdesc> - + Creates a list element. </shortdesc> <desc> - + <para> + A <classname>GtkListItem</classname> is a container widget, derived + indirectly from <classname>GtkBin</classname> and so only able to hold + one direct child. Most of the time, the child you will want the list + item to contain will be a <classname>GtkLabel</classname> - and so, in + common with all objects that have an alternative + <literal>'-with-label'</literal> constructor available in GTK, we have + the option in PHP-GTK to pass the label's text as a parameter during + construction, e.g. + <informalexample> + <programlisting role="php"> +$listitem = &new GtkListItem("This list item now has a label"); + </programlisting> + </informalexample> + </para> + <para> + If you wanted something other than a label in the list item, you simply + omit the parameter and add the required widget: + <informalexample> + <programlisting role="php"> +$arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); +$listitem = &new GtkListItem(); +$listitem->add($arrow); + </programlisting> + </informalexample> + or, if you wanted perhaps a label plus some other item: + <informalexample> + <programlisting role="php"> +$box = &new GtkHBox(); +$label = &new GtkLabel("Here we have multiple objects in a +GtkListItem"); +$arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); +$box->pack_start($label); +$box->pack_end($arrow); +$box->show_all(); +$listitem = &new GtkListItem(); +$listitem->add($box); + </programlisting> + </informalexample> + </para> + <simpara> + Whatever your list item consists of, the <classname>GtkList</classname> + will only respond to it as a <classname>GtkListItem</classname>. If you + have different kinds of list item contents in the same list, you will + need to exercise a great deal of caution if you are connecting callbacks + to any form of select signal. + </simpara> + <simpara> + See also: <classname>GtkList</classname>, which has a working example + under the constructor. + </simpara> </desc> </constructor> @@ -36,10 +244,32 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkItem">select</signalname> signal to be + emitted. </shortdesc> <desc> - + <simpara> + The <classname>GtkListItem</classname> method + <function class="GtkListItem">select()</function> causes the list item + to emit the <classname>GtkItem</classname> signal + <signalname class="GtkItem">select</signalname>. This is then bound + recursively to the <classname>GtkListItem</classname> implementation of + that signal. + </simpara> + <simpara> + The same sequence of events is produced by calling the + <classname>GtkList</classname> method + <function class="GtkList">select_child()</function>. + </simpara> + <simpara> + The easy part: it sets the <enumname>GtkStateType</enumname> of the + calling list item to <literal>GTK_STATE_SELECTED</literal>. + </simpara> + <simpara> + Note that this state can also be achieved programmatically by calling + <function class="GtkItem">toggle()</function> from a list item that + is currently unselected. + </simpara> </desc> </method> @@ -51,10 +281,32 @@ </funcprototype> </funcsynopsis> <shortdesc> - + Causes the <signalname class="GtkItem">deselect</signalname> signal to + be emitted. </shortdesc> <desc> - + <simpara> + The <classname>GtkListItem</classname> method + <function class="GtkListItem">deselect()</function> causes the list item + to emit the <classname>GtkItem</classname> signal + <signalname class="GtkItem">deselect</signalname>. This is then bound + recursively to the <classname>GtkListItem</classname> implementation of + that signal. + </simpara> + <simpara> + The same sequence of events is produced by calling the + <classname>GtkList</classname> method + <function class="GtkList">unselect_child()</function>. + </simpara> + <simpara> + The easy part: it sets the <enumname>GtkStateType</enumname> of the + calling list item to <literal>GTK_STATE_NORMAL</literal>. + </simpara> + <simpara> + Note that this state can also be achieved programmatically by calling + <function class="GtkItem">toggle()</function> from a list item that + is currently selected. + </simpara> </desc> </method> Index: php-gtk-doc/en/reference/gtk/gtkvbox.xml diff -u php-gtk-doc/en/reference/gtk/gtkvbox.xml:1.8 php-gtk-doc/en/reference/gtk/gtkvbox.xml:1.9 --- php-gtk-doc/en/reference/gtk/gtkvbox.xml:1.8 Thu Feb 14 22:26:59 2002 +++ php-gtk-doc/en/reference/gtk/gtkvbox.xml Tue Feb 26 19:13:48 2002 @@ -10,7 +10,10 @@ <simpara> <classname>GtkVBox</classname> is a box container that packs child widgets in a single column, using the packing methods inherited from - <classname>GtkBox</classname>. + <classname>GtkBox</classname>, such as + <function class="GtkBox">pack_start()</function>, as well as the less + flexible <function class="GtkContainer">add()</function> method available + to most container widgets. </simpara> <simpara> Note that all children in a <classname>GtkVBox</classname> are allocated @@ -18,8 +21,46 @@ Widgets taking up less than the allocated width are by default centered within the available area in that dimension. </simpara> - <!--TODO This is a temporary measure, example will eventually be in - the userguide but I think we need one available *now*. -sf --> + <simpara> + See also: <classname>GtkContainer</classname>, + <classname>GtkBox</classname>, <classname>GtkHBox</classname>, + <classname>GtkButtonBox</classname>, <classname>GtkTable</classname>. + </simpara> + </desc> + </classmeta> + + <constructor id="gtk.gtkvbox.constructor"> + <funcsynopsis> + <funcprototype> + <funcdef> <function>GtkVBox</function></funcdef> + <paramdef>bool + <parameter><optional>homogeneous = false</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>spacing = 0</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <shortdesc> + Creates a container for a single column of child widgets. + </shortdesc> + <desc> + <simpara> + Creates a new vertical box container designed for packing a single + column of child widgets. + </simpara> + <para> + The first parameter, <parameter>homogeneous</parameter>, is a boolean + value which, if set to <literal>true</literal>, will set each child + widget in the <classname>GtkVBox</classname> to the same height as that + of the largest child widget. The second parameter, + <parameter>spacing</parameter>, sets the minimum spacing between the + child widgets, in pixels. Leaving both parameters empty, e.g. + <informalexample> + <programlisting role="php">$vbox = &new GtkVBox();</programlisting> + </informalexample> + will set the default behaviour of individual sizing and zero spacing. + </para> <para> <example> <title>Packing child widgets using <classname>GtkVBox</classname> and @@ -61,46 +102,6 @@ Gtk::main(); </programlisting> </example> - </para> - <simpara> - See also: <classname>GtkContainer</classname>, - <classname>GtkBox</classname>, <classname>GtkHBox</classname>, - <classname>GtkButtonBox</classname>, <classname>GtkTable</classname>. - </simpara> - </desc> - </classmeta> - - <constructor id="gtk.gtkvbox.constructor"> - <funcsynopsis> - <funcprototype> - <funcdef> <function>GtkVBox</function></funcdef> - <paramdef>bool - <parameter><optional>homogeneous = false</optional></parameter> - </paramdef> - <paramdef>int - <parameter><optional>spacing = 0</optional></parameter> - </paramdef> - </funcprototype> - </funcsynopsis> - <shortdesc> - Creates a container for a single column of child widgets. - </shortdesc> - <desc> - <simpara> - Creates a new vertical box container designed for packing a single - column of child widgets. - </simpara> - <para> - The first parameter, <parameter>homogeneous</parameter>, is a boolean - value which, if set to <literal>true</literal>, will set each child - widget in the <classname>GtkVBox</classname> to the same height as that - of the largest child widget. The second parameter, - <parameter>spacing</parameter>, sets the minimum spacing between the - child widgets, in pixels. Leaving both parameters empty, e.g. - <informalexample> - <programlisting role="php">$vbox = &new GtkVBox();</programlisting> - </informalexample> - will set the default behaviour of individual sizing and zero spacing. </para> </desc> </constructor>