-
Notifications
You must be signed in to change notification settings - Fork 2
/
TreeTest.py
executable file
·41 lines (34 loc) · 1.18 KB
/
TreeTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python
import Tix
class View(object):
def __init__(self, root):
self.root = root
self.makeCheckList()
def makeCheckList(self):
self.cl = Tix.Tree(self.root)
#self.cl = Tix.Tree(self.root, browsecmd=self.selectItem)
self.cl.pack()
# this is the tixHList
self.cl.hlist.add("CL1", text="checklist1")
self.cl.hlist.add("CL1.a", text="subitem1")
self.cl.hlist.add("CL1.a.b", text="subsubitem1")
self.cl.hlist.add("CL1.a.b.c", text="subsubsubitem1")
self.cl.hlist.add("CL1.a.b.c.d", text="subsubsubsubitem1")
self.cl.hlist.add("CL1.Item1", text="subitem1")
self.cl.hlist.add("CL2", text="checklist2")
self.cl.hlist.add("CL2.Item1", text="subitem1")
#self.cl.setstatus("CL2", "on")
#self.cl.setstatus("CL2.Item1", "on")
#self.cl.setstatus("CL1", "off")
#self.cl.setstatus("CL1.Item1", "off")
self.cl.autosetmode()
def selectItem(self, item):
print item
#print item, self.cl.getstatus(item)
def main():
root = Tix.Tk()
view = View(root)
root.update()
root.mainloop()
if __name__ == '__main__':
main()