Inherits from
- ContentViewer: enthought.pyface.viewer.content_viewer.ContentViewer
Attributes
- content_provider
The content provider provides the actual tree data.
content_provider = Instance(TreeContentProvider)
- element_activated
An element has been activated (ie. double-clicked).
element_activated = Event
- element_begin_drag
A drag operation was started on an element.
element_begin_drag = Event
- element_collapsed
An element that has children has been collapsed.
element_collapsed = Event
- element_expanded
An element that has children has been expanded.
element_expanded = Event
- element_left_clicked
A left-click occurred on an element.
element_left_clicked = Event
- element_right_clicked
A right-click occurred on an element.
element_right_clicked = Event
- key_pressed
A key was pressed while the tree is in focus.
key_pressed = Event
- label_provider
The label provider provides, err, the labels for the items in the tree (a label can have text and/or an image).
label_provider = Instance(TreeLabelProvider, ())
- selection
The currently selected elements.
selection = List
- selection_mode
Selection mode (must be either of 'single' or 'extended').
selection_mode = Enum('single', 'extended')
- show_images
Should an image be shown for each element?
show_images = Bool(True)
- show_root
Should the root of the tree be shown?
show_root = Bool(True)
- STYLE
The default tree style.
STYLE = (wx.TR_EDIT_LABELS | wx.TR_HAS_BUTTONS | wx.CLIP_CHILDREN)
Method summary
- __init__(self, parent, image_size = (16, 16), **traits)
- is_expanded(self, element)
- is_selected(self, element)
- refresh(self, element)
- update(self, element)
Methods
- __init__(self, parent, image_size = (16, 16), **traits)
Creates a new tree viewer.
'parent' is the toolkit-specific control that is the tree's parent.
'image_size' is a tuple in the form (int width, int height) that specifies the size of the label images (if any) displayed in the tree.
- is_expanded(self, element)
Returns True if the element is expanded, otherwise False.
- is_selected(self, element)
Returns True if the element is selected, otherwise False.
- refresh(self, element)
Refresh the tree starting from the specified element.
Call this when the STRUCTURE of the content has changed.
- update(self, element)
Update the tree starting from the specified element.
Call this when the APPEARANCE of the content has changed.