Odd middle split in my pane?
Randall Feuerlein <[email protected]> Thu, 10 Jan 2019 13:40:42 -0800 (PST)
| Newsgroups | gmane.comp.python.wxpython.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello all, I hope this is the right place for my questions... I'm working
on a POC that contains what I need to do and I'm having trouble with my
pane being split in half.
I definitely need to be able to save a complex layout of AuiNotebook items
so that my users can restore their views later on, so if this code isn't
going to work for that I'd like to know that too.
If you look at "PanelOneNest" and "PanelTwoNest" in "PanelOne" you can see
that they are divided in half. I'm not sure what I did to cause this!
Please help, thank you!
import wx
import wx.lib.agw.aui as aui
class TabPanelOne(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)
sizer = wx.BoxSizer(wx.VERTICAL)
txtOne = wx.TextCtrl(self, wx.ID_ANY, "")
txtTwo = wx.TextCtrl(self, wx.ID_ANY, "")
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(txtOne, 0, wx.ALL, 5)
sizer.Add(txtTwo, 0, wx.ALL, 5)
self.SetSizer(sizer)
class PanelCaseDetails(wx.Panel):
def __init__(self, parent, _mgr):
wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)
sizer = wx.BoxSizer(wx.VERTICAL)
notebook = aui.AuiNotebook(self)
panelOneNest = TabPanelOne(notebook)
panelTwoNest = TabPanelOne(notebook)
notebook.AddPage(panelOneNest, "PanelOneNest", False)
notebook.AddPage(panelTwoNest, "PanelTwoNest", False)
_mgr.AddPane(notebook,
aui.AuiPaneInfo().Name("notebook_content_child").
CenterPane().PaneBorder(False))
self.SetSizer(sizer)
class MainFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY,
"AGW AUI Notebook Tutorial",
size=(600,400))
self._mgr = aui.AuiManager()
self._mgr.SetManagedWindow(self)
notebook = aui.AuiNotebook(self)
panelOne = PanelCaseDetails(notebook, self._mgr)
panelTwo = TabPanelOne(notebook)
notebook.AddPage(panelOne, "PanelOne", False)
notebook.AddPage(panelTwo, "PanelTwo", False)
self._mgr.AddPane(notebook,
aui.AuiPaneInfo().Name("notebook_content").
CenterPane().PaneBorder(True))
self._mgr.Update()
print(self._mgr.SavePerspective())
#notebook.EnableTab(0, False) #this doesn't go here but may be useful later
if __name__ == "__main__":
app = wx.PySimpleApp()
frame = MainFrame()
frame.Show()
app.MainLoop()
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.