traitsui.instance_choice module¶
Defines the various instance descriptors used by the instance editor and instance editor factory classes.
- class traitsui.instance_choice.InstanceChoice[source]¶
Bases:
InstanceChoiceItem
- name_trait = Str("name")¶
The name of the object trait containing its user interface name:
- object = Any()¶
Object associated with the item
- class traitsui.instance_choice.InstanceChoiceItem[source]¶
Bases:
ABCHasStrictTraits
- abstract is_compatible(object)[source]¶
Indicates whether a specified object is compatible with the item.
- is_factory = Bool(False)¶
Does this item create new instances?
- name = Str()¶
User interface name for the item
- view = AView¶
View associated with this item
- class traitsui.instance_choice.InstanceDropChoice[source]¶
Bases:
InstanceFactoryChoice
- droppable = True¶
Indicates whether an instance compatible with this item can be dragged and dropped rather than created . This value overrides the default.
- is_factory = False¶
Does this item create new instances? This value overrides the default.
- selectable = False¶
Indicates whether the item can be selected by the user. This value overrides the default.
- class traitsui.instance_choice.InstanceFactoryChoice[source]¶
Bases:
InstanceChoiceItem
- args = Tuple()¶
Tuple of arguments to pass to klass to create an instance
- droppable = Bool(False)¶
Indicates whether an instance compatible with this item can be dragged and dropped rather than created
- is_factory = True¶
Does this item create new instances? This value overrides the default.
- klass = Callable()¶
A class (or other callable) that can be used to create an item compatible with this item
- kw_args = Dict(Str, Any)¶
Dictionary of arguments to pass to klass to create an instance
- selectable = Bool(True)¶
Indicates whether the item can be selected by the user