wxpython

时间:2019-03-12 12:35:37

标签: python-3.x wxpython panel sizer

我有3个水平面板,我需要6个面板和6个面板中的3个子面板,如这张图片:

enter image description here

我不知道该怎么做,这是我的代码:

import wx

class MainFrame(wx.Frame):

    def __init__(self,parent):
        wx.Frame.__init__(self,parent,title="myapp",size = (800,500))
        self.left = wx.Panel(self ,style = wx.SUNKEN_BORDER,size=(200,-1))
        self.center = wx.Panel(self ,style = wx.SUNKEN_BORDER,size=(250,400))
        self.right = wx.Panel(self ,style = wx.SUNKEN_BORDER,size=(250,400))
        self.right.SetBackgroundColour('white')
        sizer1 = wx.BoxSizer(wx.HORIZONTAL)
        sizer1.Add(self.left,0,wx.EXPAND)
        sizer1.Add(self.center,1,wx.EXPAND)
        sizer1.Add(self.right,1,wx.EXPAND)
        self.SetSizer(sizer1)
        self.Show()

app = wx.App()
frame=MainFrame(None).Show()
app.MainLoop()

感谢您的帮助

0 个答案:

没有答案