Tree (beta)
Takes an arbitrary XML string, and converts it into a tree structure.
from appJar import gui
app = gui()
app.addTree("t1",
"""<people>
<person><name>Fred</name><age>45</age><gender>Male</gender></person>
<person><name>Tina</name><age>37</age><gender>Female</gender></person>
<person><name>CLive</name><age>28</age><gender>Male</gender></person>
<person><name>Betty</name><age>51</age><gender>Female</gender></person>
</people>""")
app.go()
Add Trees
.addTree(title, xml_data)
Create a tree from the specified XML data
Set Trees
.setTreeDoubleClickFunction(title, func)
Register a function to call when an item is double-clicked.setTreeEditFunction(title, func)
Register a function to call when an item is edited.setTreeEditable(title, value)
Set whether the tree can be edited.setTreeColours(title, fg, bg, fgH, bgH)
Set the fg/bg/fg highlight/bg highlight colours of the tree.setTreeBg(title, colour)
Set the background colour of the tree.setTreeFg(title, colour)
Set the foreground colour of the tree.setTreeHighlightBg(title, colour)
Set the background colour of the highlighted node.setTreeHighlightFg(title, colour)
Set the foreground colour of the highlighted node
Get Trees
.getTreeXML(title)
Return the tree as XML.getTreeSelected(title)
Return the selected node as a String.getTreeSelectedXML(title)
Return the selected node (and any children) as XML