enaml.widgets.combo_box

Classes

ComboBox

A drop-down list from which one item can be selected at a time.

class enaml.widgets.combo_box.ComboBox(parent=None, **kwargs)[source]

Bases: Control

A drop-down list from which one item can be selected at a time.

Use a combo box to select a single item from a collection of items.

See ObjectCombo for a more robust combo box control.

items

The strings to display in the combo box.

index

The integer index of the currently selected item. If the index falls outside the range of items, the item will be deselected.

selected_item

A read only cached property which returns the selected item.

editable

Whether the text in the combo box can be edited by the user.

hug_width

A combo box hugs its width weakly by default.

proxy

A reference to the ProxyComboBox object.

get_selected_item()[source]

The getter function for the selected item property.

If the index falls out of range, the selected item will be an empty string.

activated

An event fired when an object’s proxy is activated. It is triggered once during the object lifetime, at the end of the activate_proxy method.

background

The background color of the widget.

destroyed

An event fired when an object has been destroyed. It is triggered once during the object lifetime, just before the object is removed from the tree structure.

enabled

Whether or not the widget is enabled.

initialized

An event fired when an object is initialized. It is triggered once during the object lifetime, at the end of the initialize method.

name

Export the ‘name’ attribute as a declarative member.

style_class

The style class to which this item belongs. Multiple classes can be separated with whitespace. An empty string indicates the widget does not belong to any style class.