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 = container_delegate
- 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 = 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 = container_delegate
- 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 = false
- height
Requested height of the editor (in pixels). The actual displayed height is at least the maximum of width 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.
height = Int(-Const(1))
- 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 = container_delegate
- 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
- name
Name of the trait the item is editing
name = Str
- object
The HasTraits object whose trait attribute the item is editing
object = container_delegate
- 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.
resizable = false
- 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 = false
- style
Presentation style for the item
style = container_delegate
- 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). 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.
width = Int(-Const(1))
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)
- __reduce_ex__(self, protocol)
- __setstate__(self, state)
- 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)
- get(self, *names, **metadata)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same')
- 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(self, trait_change_notify = True, **traits)
- 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_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- 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.