`
wwty
  • 浏览: 536684 次
  • 性别: Icon_minigender_1
  • 来自: 北京-郑州
社区版块
存档分类
最新评论

wxPython的Core组件--其他sizer

阅读更多

1、WX.GridSizer:

wx.GridSizer(int rows=1, int cols=0, int vgap=0, int hgap=0)

 
这个Sizer用于确定表格样式的sizer;并且还可以确定一个cell在垂直的和水平方向上的空间

gs = wx.GridSizer(4, 4, 3, 3)
gs.AddMany(list items)

2、wx.FlexGridSizer:
这个sizer和wx.GridSizer非常相似,它用于布置在二维表格当中的构件,但是和wx.GridSizer相比,有了许多的灵活性。wx.GridSizer的每一个cell都是相同的,但是All cells in wx.FlexGridSizer have the same height in a row. All cells have the same width in a column.但是所有的rows and columns并不都是相同高度和相同宽度。

 fgs.AddGrowableRow(2, 1)
 fgs.AddGrowableCol(1, 1)

 这两句代码的意思是扩展第三行、第二列。通过这个方法当window窗口改变大小的时候,我们将text controls扩大。
The first two text controls will grow in horizontal direction, the third one will grow in both direction.
We must not forget to make the widgets expandable (wx.EXPAND) in order to make it really work.

3、wx.GridBagSizer:
这个Sizer是不推荐使用的,过于复杂了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics