示例#1
0
 def test_init(self):
     # Start with code slightly adapted from htest.
     sc = tree.ScrolledCanvas(
         self.root, bg="white", highlightthickness=0, takefocus=1)
     sc.frame.pack(expand=1, fill="both", side='left')
     item = tree.FileTreeItem(tree.ICONDIR)
     node = tree.TreeNode(sc.canvas, None, item)
     node.expand()
示例#2
0
 def test_init(self):
     sc = tree.ScrolledCanvas(self.root,
                              bg='white',
                              highlightthickness=0,
                              takefocus=1)
     sc.frame.pack(expand=1, fill='both', side='left')
     item = tree.FileTreeItem(tree.ICONDIR)
     node = tree.TreeNode(sc.canvas, None, item)
     node.expand()
示例#3
0
 def GetSubList(self):
     try:
         names = os.listdir(self.path)
         # 过滤掉隐藏文件
         names = list(filter(lambda x: False if x.startswith('.') else True, names))
     except OSError:
         return []
     names.sort(key = os.path.normcase)
     sublist = []
     for name in names:
         item = tree.FileTreeItem(os.path.join(self.path, name))
         sublist.append(item)
     return sublist