Inherits from
- Component: enthought.enable.component.Component
Attributes
- auto_size
Whether or not the container should auto-size itself to fit all of its components. Note: This trait is still used, but will be eventually removed in favor of fit_components.
auto_size = Bool(False)
- components
The list of components within this frame
components = Property
- container_under_layers
The layers that the container will draw first, so that they appear under the component layers of the same name.
container_under_layers = Tuple('background', 'image', 'underlay', 'mainlayer')
- default_size
The default size of this container if it is empty.
default_size = Tuple(0, 0)
- fit_components
Dimensions in which this container can resize to fit its components. This trait only applies to dimensions that are also resizable; if the container is not resizable in a certain dimension, then fit_components has no effect.
Also, note that the container does not automatically resize itself based on the value of this trait. Rather, this trait determines what value is reported in get_preferred_size(); it is up to the parent of this container to make sure that it is allocated the size that it needs by setting its bounds appropriately.
TODO: Merge resizable and this into a single trait? Or have a separate "fit" flag for each dimension in the resizable trait? TODO: This trait is used in layout methods of various Container subclasses in Chaco. We need to move those containers into Enable.
fit_components = Enum('', 'h', 'v', 'hv')
- fit_window
Whether or not the container should automatically maximize itself to fit inside the Window, if this is a top-level container.
NOTE: the way that a Container determines that it's a top-level window is that someone has explicitly set its .window attribute. If you need to do this for some other reason, you may want to turn fit_window off.
fit_window = Bool(True)
- intercept_events
If true, the container get events before its children. Otherwise, it gets them afterwards.
intercept_events = Bool(True)
- layout_controller
The layout controller determines how the container's internal layout mechanism works. It can perform the actual layout or defer to an enclosing container's layout controller. The default controller is a cooperative/recursive layout controller.
layout_controller = Instance(AbstractLayoutController)
- resolver
This object resolves queries for components
resolver = Instance(AbstractResolver)
Inherited from base classes
- accepts_focus
- active_tool
- aspect_ratio
- auto_center
- auto_handle_event
- backbuffer_padding
- bgcolor
- border_color
- border_dash
- border_visible
- border_width
- bounds
- classes
- container
- controller
- cursor_color
- cursor_style
- draw_layer
- draw_order
- draw_valid
- drawn_outer_bounds
- drawn_outer_position
- event_state
- fill_padding
- height
- hpadding
- id
- inset_border
- invisible_layout
- layout_needed
- on_trait_event
- outer_bounds
- outer_height
- outer_position
- outer_width
- outer_x
- outer_x2
- outer_y
- outer_y2
- overlay_border
- overlays
- padding
- padding_accepts_focus
- padding_bottom
- padding_left
- padding_right
- padding_top
- pointer
- position
- resizable
- set
- tools
- tooltip
- trait_added
- trait_modified
- underlays
- unified_draw
- use_backbuffer
- use_selection
- viewports
- visible
- vpadding
- width
- window
- wrappers
- x
- x2
- y
- y2
Method summary
- __components_changed(self, event)
- __components_items_changed(self, event)
- __init__(self, *components, **traits)
- add(self, *components)
- cleanup(self, window)
- compact(self)
- components_at(self, x, y)
- get(self, **kw)
- get_event_transform(self, event = None, suffix = '')
- insert(self, index, component)
- lower_component(self, component)
- normal_mouse_leave(self, event)
- raise_component(self, component)
- remove(self, *components)
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)
- as_coordinates(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)
- dispatch(self, event, suffix)
- do_layout(self, size = None, force = False)
- draw(self, gc, view_bounds = None, mode = 'default')
- draw_select_box(self, gc, position, bounds, width, dash, inset, color, bgcolor, marker_size)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- get_absolute_coords(self, *coords)
- get_preferred_size(self)
- has_traits_interface(self, *interfaces)
- invalidate_and_redraw(self)
- invalidate_draw(self, damaged_regions = None, self_relative = False)
- is_in(self, x, y)
- 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 = '')
- request_redraw(self)
- reset_traits(self, traits = None, **metadata)
- set_outer_bounds(self, ndx, val)
- set_outer_position(self, ndx, val)
- 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
- __components_changed(self, event)
- __components_items_changed(self, event)
- __init__(self, *components, **traits)
- add(self, *components)
Adds components to this container
- cleanup(self, window)
When a window viewing or containing a component is destroyed, cleanup is called on the component to give it the opportunity to delete any transient state it may have (such as backbuffers).
- compact(self)
Causes this container to update its bounds to be a compact bounding box of its components. This may cause the container to recalculate and adjust its position relative to its parent container (and adjust the positions of all of its contained components accordingly).
- components_at(self, x, y)
Returns a list of the components underneath the given point (given in the parent coordinate frame of this container).
- get(self, **kw)
Allows for querying of this container's components.
- get_event_transform(self, event = None, suffix = '')
- insert(self, index, component)
Inserts a component into a specific position in the components list
- lower_component(self, component)
Puts the indicated component to the very bottom of the Z-order
- normal_mouse_leave(self, event)
- raise_component(self, component)
Raises the indicated component to the top of the Z-order
- remove(self, *components)
Removes components from this container