def OnExpandAll(self, evt): del evt if self.expanding_all: return self.expanding_all = True try: for item in iter_tree_breadth_first(self, self.GetRootItem()): if not self.expanding_all: return node = self.GetPyData(item) if node.type == 'd': if node.state == NODE_UNPOPULATED: try: yield self.ExpandNode(node) except Exception: pass else: self.Expand(item) finally: self.expanding_all = False
def OnExpandAll(self, evt): del evt if self.expanding_all: return if not dialogs.yes_no(self, "Expanding all folders may take a long time. Continue?", icon_style=wx.ICON_WARNING): return self.expanding_all = True try: for item in iter_tree_breadth_first(self, self.GetRootItem()): if not self.expanding_all: return node = self.GetPyData(item) if node.type == 'd': if not node.populated: try: yield self.ExpandNode(node) except Exception: pass else: self.Expand(item) finally: self.expanding_all = False