0

我在面板上放了一个笔记本,笔记本有 4 页。现在我想水平分割每一页。顶部拆分将包含网格单元格,底部将包含图表。这个怎么做?

问候

4

1 回答 1

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()
于 2013-09-14T13:04:40.943 回答