traitsui.editors.tuple_editor module

Defines the tuple editor factory for all traits user interface toolkits.

class traitsui.editors.tuple_editor.SimpleEditor(parent, **traits)[source]

Bases: Editor

Simple style of editor for tuples.

The editor displays an editor for each of the fields in the tuple, based on the type of each field.

get_error_control()[source]

Returns the editor’s control for indicating error status.

init(parent)[source]

Finishes initializing the editor by creating the underlying toolkit widget.

update_editor()[source]

Updates the editor when the object trait changes external to the editor.

traitsui.editors.tuple_editor.ToolkitEditorFactory

alias of TupleEditor

class traitsui.editors.tuple_editor.TupleEditor(*args, **traits)[source]

Bases: EditorFactory

Editor factory for tuple editors.

auto_set = Bool(True)

Is user input set on every keystroke? This is applied to every field of the tuple, provided the field does not already have an ‘auto_set’ metadata or an editor defined.

cols = Int(1)

Number of tuple fields or rows

editors = List(EditorFactory)

Editors for each of the tuple fields:

enter_set = Bool(False)

Is user input set when the Enter key is pressed? This is applied to every field of the tuple, provided the field does not already have an ‘enter_set’ metadata or an editor defined.

labels = List(Str)

Labels for each of the tuple fields

types = Any()

Trait definitions for each tuple field

class traitsui.editors.tuple_editor.TupleStructure(editor)[source]

Bases: HasTraits

Creates a view containing items for each field in a tuple.

editor = Any()

Editor this structure is linked to

fields = Int()

Number of tuple fields

view = Any()

The constructed View for the tuple