我已将笔记本放在面板上,笔记本有4页。现在我想横向分割每个页面。顶部拆分将包含网格单元格,底部将包含图表。怎么做?
此致
答案 0 :(得分:1)
import wx
class MainFrame(wx.Frame):
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
panel = wx.Panel(self)
notebook = wx.Notebook(panel)
splitter_window = wx.SplitterWindow(notebook)
notebook.AddPage(splitter_window, 'Splitter')
panel1 = wx.Panel(splitter_window, style=wx.BORDER_THEME)
wx.StaticText(panel1, label='Place Grid here')
panel2 = wx.Panel(splitter_window, style=wx.BORDER_THEME)
wx.StaticText(panel2, label='Place Chart here')
splitter_window.SplitHorizontally(panel1, panel2, 50)
p_sizer = wx.BoxSizer(wx.VERTICAL)
p_sizer.Add(notebook, 1, wx.EXPAND | wx.ALL, 7)
panel.SetSizer(p_sizer)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(panel, 1, wx.EXPAND)
self.SetSizer(sizer)
if __name__ == "__main__":
app = wx.App(False)
frame = MainFrame(None)
frame.Show()
app.MainLoop()