TreeExplorer: For exploring the contents of a tree data structure.
Code: (excerpt of treexplorer.py)
1 class TETest(GuiAppD.GuiAppD):
2 appname = 'Test the TreeExplorer widget'
3
4 def createInterface(self):
5 data = NavigableTree.create_from_tuples(
6 ('data', 'this is the data node',
7 [ ('sub1', 'this is sub1 node',
8 [ ('sub11', 'This is sub11 node', [])
9 ]
10 ),
11 ('sub2', 'this is sub2 node',
12 [ ('sub21', 'this is sub21 node',
13 [ ('sub211', 'this is sub211 node', [])
14 ]
15 ),
16 ('sub22', 'this is sub22 node', [] ),
17 ('sub23', 'this is sub23 node', [] ),
18 ]
19 ),
20 ('sub3', 'this is sub3 node', []),
21 ]
22 )
23 )
24 self.explorer = SimpleTreeExplorer(
25 self.interior(),
26 labelpos = 'n',
27 label_text='TreeExplorer',
28 height=200,
29 )
30 self.explorer.pack(side=Tkinter.TOP,
31 expand=Tkinter.YES,
32 fill=Tkinter.BOTH)
33 self.explorer.component('navigator').configure(treedata=data)
34
35
36 TETest().run()
37
Screenshot: