W Wrapl, The Programming Language

Libraries:Gtk:Gtk:Combo

Types

T

Inherits from:

The T widget consists of a single-line text entry field and a drop-down list. The drop-down list is displayed when the user clicks on a small arrow button to the right of the entry field.

The drop-down list is a Gtk.Gtk.List.T widget and can be accessed using the list member of the T. List elements can contain arbitrary widgets, but if an element is not a plain label, then you must use the gtk_list_set_item_string() function. This sets the string which will be placed in the text entry field when the item is selected.

By default, the user can step through the items in the list using the arrow (cursor) keys, though this behaviour can be turned off with SetUseArrows.

As of GTK+ 2.4, T has been deprecated in favor of Gtk.Gtk.ComboBoxEntry.T.

Example 62. Creating a GtkCombo widget with simple text items.

1
2
3
4
5
6
7
8
9
GtkWidget *combo;
GList *items = NULL;
items = g_list_append (items, "First Item");
items = g_list_append (items, "Second Item");
items = g_list_append (items, "Third Item");
items = g_list_append (items, "Fourth Item");
items = g_list_append (items, "Fifth Item");
combo = gtk_combo_new ();
gtk_combo_set_popdown_strings (GTK_COMBO (combo), items);


Example 63. Creating a GtkCombo widget with a complex item.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
GtkWidget *combo, *item, *hbox, *arrow, *label;
combo = gtk_combo_new ();
item = gtk_list_item_new ();
gtk_widget_show (item);
/* You can put almost anything into the GtkListItem widget. Here we will use
   a horizontal box with an arrow and a label in it. */
hbox = gtk_hbox_new (FALSE, 3);
gtk_container_add (GTK_CONTAINER (item), hbox);
gtk_widget_show (hbox);
arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
gtk_widget_show (arrow);
gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
label = gtk_label_new ("First Item");
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
/* You must set the string to display in the entry field when the item is
   selected. */
gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (item), "1st Item");
/* Now we simply add the item to the combo's list. */
gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), item);




Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



New() : Gtk.Gtk.Combo.T

Warning

gtk_combo_new has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



Methods

:ActivateId(self @ T) : Std.Integer.SmallT

:Button(self @ T) : Gtk.Gtk.Widget.T

:CaseSensitive(self @ T) : Std.Integer.SmallT

:CurrentButton(self @ T) : Std.Integer.SmallT

:DisableActivate(self @ T) : Std.Object.T

Warning

DisableActivate has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:Entry(self @ T) : Gtk.Gtk.Widget.T

:EntryChangeId(self @ T) : Std.Integer.SmallT

:List(self @ T) : Gtk.Gtk.Widget.T

:ListChangeId(self @ T) : Std.Integer.SmallT

:OkIfEmpty(self @ T) : Std.Integer.SmallT

:Popwin(self @ T) : Gtk.Gtk.Widget.T

:SetCaseSensitive(self @ T, val @ Std.Symbol.T) : Std.Object.T

Warning

SetCaseSensitive has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:SetItemString(self @ T, item @ Gtk.Gtk.Item.T, item_value @ Std.String.T) : Std.Object.T

Warning

SetItemString has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:SetPopdownStrings(self @ T, strings @ Std.Object.T) : Std.Object.T

Warning

SetPopdownStrings has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:SetUseArrows(self @ T, val @ Std.Symbol.T) : Std.Object.T

Warning

SetUseArrows has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:SetUseArrowsAlways(self @ T, val @ Std.Symbol.T) : Std.Object.T

Warning

SetUseArrowsAlways has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:SetValueInList(self @ T, val @ Std.Symbol.T, ok_if_empty @ Std.Symbol.T) : Std.Object.T

Warning

SetValueInList has been deprecated since version 2.4 and should not be used in newly-written code. Use Gtk.Gtk.ComboBox.T instead.



:UseArrows(self @ T) : Std.Integer.SmallT

:UseArrowsAlways(self @ T) : Std.Integer.SmallT

:ValueInList(self @ T) : Std.Integer.SmallT

:setActivateId(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setButton(self @ T, value @ Gtk.Gtk.Widget.T) : Gtk.Gtk.Widget.T

:setCaseSensitive(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setCurrentButton(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setEntry(self @ T, value @ Gtk.Gtk.Widget.T) : Gtk.Gtk.Widget.T

:setEntryChangeId(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setList(self @ T, value @ Gtk.Gtk.Widget.T) : Gtk.Gtk.Widget.T

:setListChangeId(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setOkIfEmpty(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setPopup(self @ T, value @ Gtk.Gtk.Widget.T) : Gtk.Gtk.Widget.T

:setPopwin(self @ T, value @ Gtk.Gtk.Widget.T) : Gtk.Gtk.Widget.T

:setUseArrows(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setUseArrowsAlways(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setValueInList(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT