gtk.Combo — a text entry field with a dropdown list.
gobject.GObject+-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Box +-- gtk.HBox +-- gtk.Combo
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.List widget and can be accessed using the list
attribute of the
elements can contain arbitrary widgets, but if an element is not a plain
label, then you must use the
gtk.List.set_item_string() method. This sets the
string which will be placed in the text entry field when the item is
By default, the user can step through the items in the list using
the arrow (cursor) keys, though this behavior can be turned off with the
method. Normally the arrow keys are only active when the contents of the
text entry field matches one of the items in the list. If the contents of
the entry field do not match any of the list items, then pressing the arrow
keys does nothing. However, by calling
you can specify that the arrow keys are always active. If the contents of
the entry field does not match any of the items in the list, then pressing
the up or down arrow key will set the entry field to the last or first item
in the list, respectively.
Note the list attribute references a gtk.List which is a deprecated widget so the combo widget may be changed or deprecated in the future.
|a combo object*|
Creates an new
|If True the value entered must match one of the values in the list.|
|If True an empty value is considered valid.|
specifies whether the value entered in the text entry field must match one
of the values in the list. This method sets the "value-in-list" property to
the value of
val and the "allow-empty" property to
the value of
val is True the user will not be able
to perform any other action (the widget grabs the focus) until a valid value
has been entered. If
ok_if_empty is True an empty
field is considered an acceptable value.
|If True can be used to navigate through the list items|
set_use_arrows() method sets the
"enable-use-arrows" property to the value of
val is True the arrows keys can be used to navigate
through the list items.
|If True the arrow keys will still work even if the text entry field does not match any of the list items.|
set_use_arrows_always() method sets
the "enable-arrows-always" property to the values of
val is True the arrow
keys will work even if the text entry field does not match any of the list
|If True the text in the list items is case sensitive.|
set_case_sensitive() method sets
the "case-sensitive" property to the value of
val is True the text in the combo list items and the
text entry field are case sensitive. The default value of
"set-case-sensitive" is False.
|a list item|
|a string to place in the entry field when
set_item_string() method sets the
item_value) to place in the combo text
entry field when the
item is selected. This method is
only needed if the list item is other than a simple label (e.g. a
|a list of strings to populate the list|
set_popdown_strings() method is a
convenience method that sets the strings used in the popdown list from.
strings (a Python list or tuple object).