Hi All,
I have hit a roadblock and am looking for some help/ideas..
In my app, there is a two-pane interface (using a splitter window),
the left pane has a tree and the right pane contents change according
to the node selected on the left.
The rightpane has a title panel that tells what folder is current
selected. The way I have designed the rightpane, the title panel is
always there and I call SetLabel() to alter the title.
The second item in the rightpane sizer is a panel that changes
contents. Each node type has its panel type, so if I have 3 different
node types, I have 3 totally different panel types with different
widgets and data, each panel type being a singleton).
I tried doing the following:
def _createContentPanel(self, pnlContent):
if not self.pnlContentCalled:
self.pnlContentCalled = True
self.box.Add(pnlContent, 1, wx.EXPAND|wx.ALL, 0)
else:
#sizerItem = self.box.GetItem(1)
#sizerItem.SetWindow(pnlContent)
self.box.Remove(1)
self.box.Insert(1, pnlContent, 1, wx.EXPAND|wx.ALL, 0)
self.Layout()
self.box.Layout()
self.Refresh()
1. self.box = wx.BoxSizer(wx.VERTICAL)
2. The 0th item in self.box is the title panel
(commented lines indicate my other desperate attempts.
sizerItem.RemoveWindows works but I can not use it as I end up doing
what I am trying to avoid...recreate the panels each time)
The code above, I had hoped would replace the previous window in the
size with my new panel. The reason I am doing it this way to minimize
creation of new widgets.
How do I replace the content panel in the sizer?
Thank you,
-Kartic