]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-11/gridbagsizer.py
2 from blockwindow
import BlockWindow
4 labels
= "one two three four five six seven eight nine".split()
6 class TestFrame(wx
.Frame
):
8 wx
.Frame
.__init
__(self
, None, -1, "GridBagSizer Test")
9 sizer
= wx
.GridBagSizer(hgap
=5, vgap
=5)
12 bw
= BlockWindow(self
, label
=labels
[row
*3 + col
])
13 sizer
.Add(bw
, pos
=(row
,col
))
15 # add a window that spans several rows
16 bw
= BlockWindow(self
, label
="span 3 rows")
17 sizer
.Add(bw
, pos
=(0,3), span
=(3,1), flag
=wx
.EXPAND
)
19 # add a window that spans all columns
20 bw
= BlockWindow(self
, label
="span all columns")
21 sizer
.Add(bw
, pos
=(3,0), span
=(1,4), flag
=wx
.EXPAND
)
23 # make the last row and col be stretchable
24 sizer
.AddGrowableCol(3)
25 sizer
.AddGrowableRow(3)
31 app
= wx
.PySimpleApp()