Page Contents

This Page

ComboBox

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

Bases: enaml.widgets.control.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.

items = None

The unicode strings to display in the combo box.

index = None

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

editable = None

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

selected_item = None

A readonly property that will return the currently selected item. If the index falls out of range, the selected item will be the empty string.

hug_width = None

How strongly a component hugs it’s contents’ width. ComboBoxes hug width weakly, by default.

snapshot()[source]

Returns the dict of creation attributes for the combo box.

bind()[source]

A method called after initialization which allows the widget to bind any event handlers necessary.

on_action_index_changed(content)[source]

The message handler for the ‘index_changed’ action from the client widget. The content will contain the selected ‘index’.

__implements__

alias of __NoInterface__

Backends

Qt

Inheritance diagram of enaml.qt.qt_combo_box.QtComboBox

class enaml.qt.qt_combo_box.QtComboBox(object_id, parent, session)[source]

Bases: enaml.qt.qt_control.QtControl

A Qt implementation of an Enaml ComboBox.

create_widget(parent, tree)[source]

Create the underlying combo box widget.

create(tree)[source]

Create and initialize the underlying widget.

on_action_set_index(content)[source]

Handle the ‘set_index’ action from the Enaml widget.

on_action_set_items(content)[source]

Handle the ‘set_items’ action from the Enaml widget.

on_action_set_editable(content)[source]

Handle the ‘set_editable’ action from the Enaml widget.

on_index_changed()[source]

The signal handler for the index changed signal.

set_items(items)[source]

Set the items of the ComboBox.

set_index(index)[source]

Set the current index of the ComboBox.

set_editable(editable)[source]

Set whether the combo box is editable.

Wx

Inheritance diagram of enaml.wx.wx_combo_box.WxComboBox

class enaml.wx.wx_combo_box.WxComboBox(object_id, parent, session)[source]

Bases: enaml.wx.wx_control.WxControl

A Wx implementation of an Enaml ComboBox.

create_widget(parent, tree)[source]

Create the underlying wx.ComboBox widget.

create(tree)[source]

Create and initialize the combo box control.

on_action_set_index(content)[source]

Handle the ‘set_index’ action from the Enaml widget.

on_action_set_items(content)[source]

Handle the ‘set_items’ action from the Enaml widget.

on_index_changed(event)[source]

The signal handler for the index changed signal.

set_items(items)[source]

Set the items of the ComboBox.

set_index(index)[source]

Set the current index of the ComboBox