traitsui.editors.instance_editor module

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

class traitsui.editors.instance_editor.InstanceEditor(*args, **traits)[source]

Bases: EditorFactory

Editor factory for instance editors.

adapter = Type(InstanceChoice, allow_none=False)

The default adapter class used to create InstanceChoice compatible adapters for instance objects:

cachable = Bool(True)

Should factory-created objects be cached?

droppable = Bool(False)

Should the editor support drag and drop of objects to set the trait value (a value of True forces the editor to allow drag and drop, while a value of False only supports drag and drop if at least one item in the list of possible objects supports drag and drop):

editable = Bool(True)

Is the current value of the object trait editable (vs. merely selectable)?

id = Str()

The ID to use with the view

kind = AKind

Kind of pop-up editor (live, modal, nonmodal, wizard)

label = Str()

Optional label for button

name = Str()

Extended name of the context object trait containing the list of types of selectable or editable instances

orientation = Enum("default", "horizontal", "vertical")

The orientation of the instance editor relative to the instance selector

selectable = Bool(False)

Should the object trait value be selectable from a list of objects (a value of True forces a selection list to be displayed, while a value of False displays a selection list only if at least one object in the list of possible object values is selectable):

values = List(InstanceChoiceItem)

List of items describing the types of selectable or editable instances

view = AView

Optional instance view to use

view_name = Str()

Extended name of the context object trait containing the view, or name of the view, to use

traitsui.editors.instance_editor.ToolkitEditorFactory

alias of InstanceEditor