Inherits from
- HasTraits: enthought.traits.has_traits.HasTraits
Attributes
- nodes_changed
Fired when nodes in the tree have changed in some way that affects their appearance but NOT their structure or position in the tree.
nodes_changed = Event(NodeEvent)
- nodes_inserted
Fired when nodes have been inserted into the tree.
nodes_inserted = Event(NodeEvent)
- nodes_removed
Fired when nodes have been removed from the tree.
nodes_removed = Event(NodeEvent)
- nodes_replaced
Fired when nodes have been replaced in the tree.
nodes_replaced = Event(NodeEvent)
- root
The root of the model.
root = Any
- structure_changed
Fire when the structure of the tree has changed DRASTICALLY from a given node down.
structure_changed = Event(NodeEvent)
Method summary
- add_listener(self, node)
- can_drop(self, node, obj)
- can_set_text(self, node, text)
- drop(self, node, obj)
- fire_nodes_changed(self, node, children)
- fire_nodes_inserted(self, node, children)
- fire_nodes_removed(self, parent, children)
- fire_nodes_replaced(self, node, old_children, new_children)
- fire_structure_changed(self, node)
- get_children(self, node)
- get_drag_value(self, node)
- get_image(self, node, selected, expanded)
- get_key(self, node)
- get_selection_value(self, node)
- get_text(self, node)
- has_children(self, node)
- is_collapsible(self, node)
- is_draggable(self, node)
- is_editable(self, node)
- is_expandable(self, node)
- remove_listener(self, node)
- set_text(self, node, text)
Methods
- add_listener(self, node)
Adds a listener for changes to a node.
- can_drop(self, node, obj)
Returns True if a node allows an object to be dropped onto it.
- can_set_text(self, node, text)
Returns True if the node's label can be set.
- drop(self, node, obj)
Drops an object onto a node.
- fire_nodes_changed(self, node, children)
Fires the nodes changed event.
- fire_nodes_inserted(self, node, children)
Fires the nodes inserted event.
- fire_nodes_removed(self, parent, children)
Fires the nodes removed event.
- fire_nodes_replaced(self, node, old_children, new_children)
Fires the nodes removed event.
- fire_structure_changed(self, node)
Fires the structure changed event.
- get_children(self, node)
Returns the children of a node.
- get_drag_value(self, node)
Get the value that is dragged for a node.
By default the drag value is the node itself.
- get_image(self, node, selected, expanded)
Returns the label image for a node.
Return None (the default) if no image is required.
- get_key(self, node)
Generate a unique key for a node.
- get_selection_value(self, node)
Get the value that is used when a node is selected.
By default the selection value is the node itself.
- get_text(self, node)
Returns the label text for a node.
Return None if no text is required. By default we return 'str(node)'.
- has_children(self, node)
Returns True if a node has children, otherwise False.
This method is provided in case the model has an efficient way to determine whether or not a node has any children without having to actually get the children themselves.
- is_collapsible(self, node)
Returns True if the node is collapsible, otherwise False.
- is_draggable(self, node)
Returns True if the node is draggable, otherwise False.
- is_editable(self, node)
Returns True if the node is editable, otherwise False.
If the node is editable, its text can be set via the UI.
- is_expandable(self, node)
Returns True if the node is expandanble, otherwise False.
- remove_listener(self, node)
Removes a listener for changes to a node.
- set_text(self, node, text)
Sets the label text for a node.