sugar4.graphics.combobox
The combobox module provides a combo box; a button like widget which creates a list popup when clicked. It’s best used outside of a toolbar when the user needs to choose from a short list of items.
Example:
Classes
This class provides a simple wrapper based on the |
Module Contents
- class sugar4.graphics.combobox.ComboBox[source]
Bases:
gi.repository.Gtk.ComboBoxThis class provides a simple wrapper based on the
Gtk.ComboBox. This lets you make a list of items, with a value, label and optionally an icon.- get_value()[source]
The value of the currently selected item; the same as the value argument that was passed to the append_item func.
- Returns:
object, value of selected item
- append_item(value, text, icon_name=None, file_name=None)[source]
This function adds another item to the bottom of the combo box list.
If either icon_name or file_name are supplied and icon column will be added to the combo box list.
- Parameters:
value (object) – the value that will be returned by get_value, when this item is selected
text (str) – the user visible label for the item
icon_name (str) – the name of the icon in the theme to use for this item, optional and conflicting with file_name
file_name (str) – the path to a sugar (svg) icon to use for this item, optional and conflicting with icon_name
- append_separator()[source]
Add a separator to the bottom of the combo box list. The separator can not be selected.