idlelib.TreeWidget
index
/usr/local/lib/python2.3/idlelib/TreeWidget.py

# XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - key bindings (instead of quick-n-dirty bindings on Canvas):
#   - up/down arrow keys to move focus around
#   - ditto for page up/down, home/end
#   - left/right arrows to expand/collapse & move out/in
# - more doc strings
# - add icons for "file", "module", "class", "method"; better "python" icon
# - callback for selection???
# - multiple-item selection
# - tooltips
# - redo geometry without magic numbers
# - keep track of object ids to allow more careful cleaning
# - optimize tree redraw after expand of subnode

 
Modules
       
idlelib.ZoomHeight
imp
os
sys

 
Classes
       
ScrolledCanvas
TreeItem
FileTreeItem
TreeNode

 
class FileTreeItem(TreeItem)
    Example TreeItem subclass -- browse the file system.
 
  Methods defined here:
GetIconName(self)
GetSubList(self)
GetText(self)
IsEditable(self)
IsExpandable(self)
SetText(self, text)
__init__(self, path)

Methods inherited from TreeItem:
GetLabelText(self)
Return label text string to display in front of text (if any).
GetSelectedIconName(self)
Return name of icon to be displayed when selected.
OnDoubleClick(self)
Called on a double-click on the item.

Data and other attributes inherited from TreeItem:
expandable = None

 
class ScrolledCanvas
     Methods defined here:
__init__(self, master, **opts)
page_down(self, event)
page_up(self, event)
unit_down(self, event)
unit_up(self, event)
zoom_height(self, event)

 
class TreeItem
    Abstract class representing tree items.
 
Methods should typically be overridden, otherwise a default action
is used.
 
  Methods defined here:
GetIconName(self)
Return name of icon to be displayed normally.
GetLabelText(self)
Return label text string to display in front of text (if any).
GetSelectedIconName(self)
Return name of icon to be displayed when selected.
GetSubList(self)
Return list of items forming sublist.
GetText(self)
Return text string to display.
IsEditable(self)
Return whether the item's text may be edited.
IsExpandable(self)
Return whether there are subitems.
OnDoubleClick(self)
Called on a double-click on the item.
SetText(self, text)
Change the item's text (if it is editable).
__init__(self)
Constructor.  Do whatever you need to do.

Data and other attributes defined here:
expandable = None

 
class TreeNode
     Methods defined here:
__init__(self, canvas, parent, item)
collapse(self, event=None)
deselect(self, event=None)
deselectall(self)
deselecttree(self)
destroy(self)
draw(self, x, y)
drawicon(self)
drawtext(self)
edit(self, event=None)
edit_cancel(self, event=None)
edit_finish(self, event=None)
expand(self, event=None)
flip(self, event=None)
geticonimage(self, name)
lastvisiblechild(self)
select(self, event=None)
select_or_edit(self, event=None)
update(self)
view(self)

 
Functions
       
listicons(icondir='/usr/local/lib/python2.3/idlelib/Icons')
Utility to display the available icons.
test()
test2()

 
Data
        ICONDIR = '/usr/local/lib/python2.3/idlelib/Icons'