设为首页 加入收藏

TOP

wxpython 窗口排版- proportion/flag/border参数说明(二)
2017-09-30 16:56:20 】 浏览:4799
Tags:wxpython 窗口 排版 proportion/flag/border 参数 说明
FT,border = 5 )
         # proportion=2 代表当容器大小变化时,text_filename控件的大小变化,变化速度为2
        bsizer_center.Add(self.text_filename,proportion=2,flag=wx.EXPAND|wx.ALL,border=5)
        bsizer_center.Add(self.bt_open,proportion=1,flag=wx.ALL,border=5)
        bsizer_center.Add(self.bt_save,proportion=0,flag=wx.ALL,border=5)
        
        bsizer_bottom.Add(self.text_contents,proportion=1 ,flag = wx.EXPAND|wx.ALL,border =5 )
        
         # wx.VERTICAL 横向分割
        bsizer_all = wx.BoxSizer(wx.VERTICAL)
         # 添加顶部sizer,proportion=0 代表bsizer_top大小不可变化
        bsizer_all.Add(bsizer_top,proportion=0,flag=wx.EXPAND|wx.ALL,border=5)
        bsizer_all.Add(bsizer_center,proportion=0,flag=wx.EXPAND|wx.ALL,border=5)
         # 添加顶部sizer,proportion=1 代表bsizer_bottom大小变化
        bsizer_all.Add(bsizer_bottom,proportion=1,flag=wx.EXPAND|wx.ALL,border=5)
        self.Bind(wx.EVT_BUTTON,self.onOpen,self.bt_open)
         # self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)
    
        panel.SetSizer(bsizer_all)


     def onOpen(self,event): 
        self.text_contents.AppendText(str(self.GetSizeTuple()))
        self.text_contents.AppendText(str(self.bt_open.GetSizeTuple()))
        self.text_contents.AppendText(str(self.text_filename.GetSizeTuple()))
        self.SetSize((700,600))
        self.text_contents.AppendText(str(self.GetSizeTuple()))
        self.text_contents.AppendText(str(self.bt_open.GetSizeTuple()))
        self.text_contents.AppendText(str(self.text_filename.GetSizeTuple()))        


if  __name__ ==  ' __main__ ':
    app = wx.PySimpleApp()
    frame = MyFrame(parent = None, id = -1)
    frame.Show()
    frame.Center()
    app.MainLoop()

3、总结

1、Box = wx.BoxSizer(integer orie

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇python魔法方法-属性转换和类的表.. 下一篇CoolPlist 帧动画自动生成工具

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目