'Recursively traverses the data structure, adding tree nodes to
match it.'

def AddTreeNodes(self, parentItem, items):

    for item in items:
        if (type(item) == str):
            child = self.tree.AppendItem(parentItem, item)
            self.tree.SetItemImage(child, self.fileidx, wx.TreeItemIcon_Normal)
            self.tree.SetItemImage(child, self.fldropenidx, wx.TreeItemIcon_Expanded)
        else:
            newItem = self.tree.AppendItem(parentItem, item[0])
            self.tree.SetItemImage(newItem, self.fldridx, wx.TreeItemIcon_Normal)
            self.tree.SetItemImage(newItem, self.fldropenidx, wx.TreeItemIcon_Expanded)
            self.AddTreeNodes(newItem, item[1])
