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’.

Backends

Qt

digraph inheritancec17e5697eb { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "QtWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.qt.qt_widget.QtWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtObject" -> "QtWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.qt.qt_constraints_widget.QtConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtWidget" -> "QtConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtComboBox" [style="setlinewidth(0.5)",URL="#enaml.qt.qt_combo_box.QtComboBox",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtControl" -> "QtComboBox" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "QtControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.qt.qt_control.QtControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "QtConstraintsWidget" -> "QtControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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

digraph inheritanceb17f881545 { rankdir=LR; width=8.0; ratio=compress; fontsize=14; size="8.0, 12.0"; "WxConstraintsWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.constraints_widget.ConstraintsWidget.html#enaml.wx.wx_constraints_widget.WxConstraintsWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxWidget" -> "WxConstraintsWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxWidget" [style="setlinewidth(0.5)",URL="enaml.widgets.widget.Widget.html#enaml.wx.wx_widget.WxWidget",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxObject" -> "WxWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxControl" [style="setlinewidth(0.5)",URL="enaml.widgets.control.Control.html#enaml.wx.wx_control.WxControl",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxConstraintsWidget" -> "WxControl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WxObject" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25]; "WxComboBox" [style="setlinewidth(0.5)",URL="#enaml.wx.wx_combo_box.WxComboBox",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "WxControl" -> "WxComboBox" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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