但是,如果不启动应用程序并使用鼠标堆叠窗格,我找不到任何说明如何执行此操作的文档
我也不想用aui.notebook
import wx
import wx.lib.agw.aui as aui
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent)
# create the AuiManager object
self._mgr = aui.AuiManager(self)
# create the panes
pane1 = wx.TextCtrl(self, -1, "Pane 1")
pane2 = wx.TextCtrl(self, -1, "Pane 2")
# add the panes to the AuiManager and stack them vertically
self._mgr.AddPane(pane1, aui.AuiPaneInfo().Name("pane1").Caption("Pane 1").Left())
self._mgr.AddPane(pane2, aui.AuiPaneInfo().Name("pane2").Caption("Pane 2").Bottom().Layer(1).Position(1))
# configure the AuiManager
self._mgr.Update()
# create the app and frame
app = wx.App()
frame = MyFrame(None)
frame.Show()
app.MainLoop()
非常感谢您的帮助:)
import wx
import wx.lib.agw.aui as aui
class MyFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent)
# create the AuiManager object
self._mgr = aui.AuiManager(self)
# create the panes
pane1 = wx.TextCtrl(self, -1, "Pane 1")
pane2 = wx.TextCtrl(self, -1, "Pane 2")
# add the panes to the AuiManager and stack them vertically
self._mgr.AddPane(pane1, aui.AuiPaneInfo().Name("P1").Caption("P1-Caption").Center().MinSize((10, 10)).BestSize((200, 100)))
self._mgr.AddPane(pane2, aui.AuiPaneInfo().Name("P2").Caption("P2-Caption").Center().MinSize((10, 10)).BestSize((200, 100)),\
target=self._mgr.GetPane("P1")) # target stacks the pane's to tabs
# configure the AuiManager
self._mgr.Update()
# create the app and frame
app = wx.App()
frame = MyFrame(None)
frame.Show()
app.MainLoop()