Hello,
I have a aui.Manager pane that contains a wx.TreeCtrl:
self.network_element = self.NetworkExplorer()
self._mgr.AddPane(self.network_element, wx.aui.AuiPaneInfo().
Name(“NE”).Caption(“Network Explorer”).
Right().Layer(1).Position(1).CloseButton(True).MaximizeButton(True))
def NetworkExplorer(self, tree_data=’’):
tree = wx.TreeCtrl(self, -1, wx.Point(0, 0), wx.Size(400, 200),wx.TR_DEFAULT_STYLE | wx.NO_BORDER)
root = tree.AddRoot(“Nodes”)
items = []
j = 0
imglist = wx.ImageList(16, 16, True, 2)
imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16)))
imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16,16)))
tree.AssignImageList(imglist)
if tree_data == ‘’:
items.append(tree.AppendItem(root, “”, 0))
tree.AppendItem(items[0], “”, 1)
else:
for c in tree_data.keys():
items.append(tree.AppendItem(root, c, 0))
for n in tree_data[c]:
tree.AppendItem(items[j], n, 1)
j = j+1
tree.Expand(root)
tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged)
self.tree = tree
tree.SetMinSize((1800,-1))
return tree
Now, I am trying to trying to change the content of the TreeCtrl in the aui.Manager pane with the following code:
Query for all network elements and update the network explorer pane
for i in self.table.find({‘mo’:‘ManagedElement’}):
l = []
key = str(i[‘node_name’])
for r in self.table.find({‘mo’:‘IubLink’,‘node_name’:key}):
l.append(str(r[‘IubLinkId’]))
ne[key] = l
self.network_element = self.NetworkExplorer(ne)
self._mgr.Update()
But the tree control in the pane is not being updated.
How do I update the TreeCtrl in the aui.Manager pane (i.e self._mgr.GetPane(“NE”))?
Austin