Tree helper class that's instantiated for each element in the tree.
It has several useful attributes: parent_node - immediate parent node
id - id assigned at creation expanded_icon - image
displayed when folder is expanded to display children collapsed_icon -
image displayed when node is not a folder or folder is collapsed.
parent_widget - reference to tree widget that contains node.
expandable_flag - is true when node is a folder that may be expanded or
collapsed. expanded_flag - true to indicate node is currently expanded.
h_line - canvas line to left of node image. v_line -
canvas line below node image that connects children. indic -
expand/collapse canvas image. label - canvas text label symbol
- current canvas image
Please note that methods prefixed PVT_* are not meant to be used by
client programs.
|
__init__(self,
parent_node,
id,
collapsed_icon,
x,
y,
parent_widget=None,
expanded_icon=None,
label=None,
expandable_flag=0)
Create node and initialize it. |
source code
|
|
|
set_collapsed_icon(self,
icon)
Set node's collapsed image |
source code
|
|
|
set_expanded_icon(self,
icon)
Set node's expanded image |
source code
|
|
|
|
|
prev_sib(self)
Return node's previous sibling (the child immediately above it) |
source code
|
|
|
next_sib(self)
Return node's next sibling (the child immediately below it) |
source code
|
|
|
next_visible(self)
Return next lower visible node |
source code
|
|
|
prev_visible(self)
Return next higher visible node |
source code
|
|
|
children(self)
Return list of node's children |
source code
|
|
|
get_label(self)
Return string containing text of current label |
source code
|
|
|
set_label(self,
label)
Set current text label |
source code
|
|
|
expanded(self)
Returns true if node is currently expanded, false otherwise |
source code
|
|
|
|
|
full_id(self)
Return list of IDs of all parents and node ID |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toggle_state(self)
Toggle node's state between expanded and collapsed, if possible |
source code
|
|
|
PVT_enter(self,
event)
detect mouse hover for drag'n'drop |
source code
|
|
|
|
|
PVT_last(self)
Return bottom-most node in subtree |
source code
|
|
|
PVT_find(self,
search)
Used by searching functions |
source code
|
|
|
|
|
|
|
PVT_cleanup_lines(self)
Resize connecting lines |
source code
|
|
|
PVT_update_scrollregion(self)
Update scroll region for new size |
source code
|
|
|
PVT_delete_subtree(self)
Recursively delete subtree & clean up cyclic references to make
garbage collection happy |
source code
|
|
|
|
|
PVT_tag_move(self,
dist)
Move everything below current icon, to make room for subtree using
the Disney magic of item tags. |
source code
|
|
|
PVT_click(self,
event)
Handle mouse clicks by kicking off possible drag'n'drop processing |
source code
|
|