Inherits from
- ViewSubElement: enthought.traits.ui.view_element.ViewSubElement
Attributes
- defined_when
Pre-condition for including the item in the display. If the expression evaluates to False, the item is not defined in the display. Conditions for defined_when are evaluated only once, when the display is first constructed. Use this attribute for conditions based on attributes that vary from object to object, but that do not change over time. For example, displaying a 'maiden_name' item only for female employees in a company database.
defined_when = Str
- dock
Docking style for the item:
dock = ContainerDelegate
- editor
Editor to use for the item:
editor = ItemEditor
- emphasized
Should the item's label use emphasized text? If the label is not shown, this attribute is ignored.
emphasized = Bool(False)
- enabled_when
Pre-condition for enabling the item. If the expression evaluates to False, the widget is disabled, that is, it does not accept input. All enabled_when conditions are checked each time that any trait value is edited in the display. Therefore, you can use enabled_when conditions to enable or disable widgets in response to user input.
enabled_when = Str
- export
Category of elements dragged from view:
export = ContainerDelegate
- format_func
A Callable to use for formatting the contents of the item. This function or method is called to create the string representation of the trait value to be edited. If the widget does not use a string representation, this attribute is ignored.
format_func = Callable
- format_str
Python format string to use for formatting the contents of the item. The format string is applied to the string representation of the trait value before it is displayed in the widget. This attribute is ignored if the widget does not use a string representation, or if the format_func is set.
format_str = Str
- has_focus
Should the item receive focus initially?
has_focus = Bool(False)
- height
Requested height of the editor (in pixels or fraction of available height). For pixel values (i.e. values not in the range from 0.0 to 1.0), the actual displayed height is at least the maximum of height and the optimal height of the widget as calculated by the GUI toolkit. Specify a negative value to ignore the toolkit's optimal height. For example, use -50 to force a height of 50 pixels. The default value of -1 ensures that the toolkit's optimal height is used.
A value in the range from 0.0 to 1.0 specifies the fraction of the available height to assign to the editor. Note that the value is not an absolute value, but is relative to other item's whose height is also in the 0.0 to 1.0 range. For example, if you have two item's with a height of 0.1, and one item with a height of 0.2, the first two items will each receive 25% of the available height, while the third item will receive 50% of the available height. The available height is the total height of the view minus the height of any item's with fixed pixel sizes (i.e. height values not in the 0.0 to 1.0 range).
height = Float(-Const(1.0))
- help
Help text describing the purpose of the item. The built-in help handler displays this text in a pop-up window if the user clicks the widget's label. View-level help displays the help text for all items in a view. If this attribute is not set, the built-in help handler generates a description based on the trait definition.
help = Str
- id
A unique identifier for the item. If not set, it defaults to the value of name.
id = Str
- image
Image to display on notebook tabs:
image = ContainerDelegate
- invalid
The extended trait name of the trait containing the item's invalid state status (passed through to the item's editor):
invalid = Str
- item_theme
The theme to use for the item itself:
item_theme = ContainerDelegate
- label
User interface label for the item in the GUI. If this attribute is not set, the label is the value of name with slight modifications: underscores are replaced by spaces, and the first letter is capitalized. If an item's name is not specified, its label is displayed as static text, without any editor widget.
label = Str
- label_theme
The theme to use for the item's label:
label_theme = ContainerDelegate
- name
Name of the trait the item is editing:
name = Str
- object
The HasTraits object whose trait attribute the item is editing:
object = ContainerDelegate
- padding
Amount of extra space, in pixels, to add around the item. Values must be integers between -15 and 15. Use negative values to subtract from the default spacing.
padding = Padding
- resizable
Should the item use extra space? If set to True, the widget expands to fill any extra space that is available in the display. If set to True for more than one item in the same View, any extra space is divided between them. If set to False, the widget uses only whatever space it is explicitly (or implicitly) assigned. The default value of Undefined means that the use (or non-use) of extra space will be determined by the editor associated with the item.
resizable = Bool(Undefined)
- show_label
Should a label be displayed for the item?
show_label = Delegate('container', 'show_labels')
- springy
Should the item use extra space along its Group's layout orientation?
springy = Bool(False)
- style
Presentation style for the item:
style = ContainerDelegate
- tooltip
Tooltip to display over the item, when the mouse pointer is left idle over the widget. Make this text as concise as possible; use the help attribute to provide more detailed information.
tooltip = Str
- visible_when
Pre-condition for showing the item. If the expression evaluates to False, the widget is not visible (and disappears if it was previously visible). If the value evaluates to True, the widget becomes visible. All visible_when conditions are checked each time that any trait value is edited in the display. Therefore, you can use visible_when conditions to hide or show widgets in response to user input.
visible_when = Str
- width
Requested width of the editor (in pixels or fraction of available width). For pixel values (i.e. values not in the range from 0.0 to 1.0), the actual displayed width is at least the maximum of width and the optimal width of the widget as calculated by the GUI toolkit. Specify a negative value to ignore the toolkit's optimal width. For example, use -50 to force a width of 50 pixels. The default value of -1 ensures that the toolkit's optimal width is used.
A value in the range from 0.0 to 1.0 specifies the fraction of the available width to assign to the editor. Note that the value is not an absolute value, but is relative to other item's whose width is also in the 0.0 to 1.0 range. For example, if you have two item's with a width of 0.1, and one item with a width of 0.2, the first two items will each receive 25% of the available width, while the third item will receive 50% of the available width. The available width is the total width of the view minus the width of any item's with fixed pixel sizes (i.e. width values not in the 0.0 to 1.0 range).
width = Float(-Const(1.0))
Inherited from base classes
Method summary
- __init__(self, value = None, **traits)
- __repr__(self)
- get_help(self, ui)
- get_id(self)
- get_label(self, ui)
- is_includable(self)
- is_spacer(self)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- replace_include(self, view_elements)
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __init__(self, value = None, **traits)
Initializes the item object.
- __repr__(self)
Returns a "pretty print" version of the Item.
- get_help(self, ui)
Gets the help text associated with the Item in a specified UI.
- get_id(self)
Returns an ID used to identify the item.
- get_label(self, ui)
Gets the label to use for a specified Item.
- is_includable(self)
Returns a Boolean indicating whether the object is replaceable by an Include object.
- is_spacer(self)
Returns True if the item represents a spacer or separator.