]> git.saurik.com Git - wxWidgets.git/blame - wxPython/samples/wxPIA_book/Chapter-11/resizeflexgridsizer.py
fix building/running of tex2rtf
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-11 / resizeflexgridsizer.py
CommitLineData
be05b434
RD
1import wx
2from blockwindow import BlockWindow
3
4labels = "one two three four five six seven eight nine".split()
5
6class TestFrame(wx.Frame):
7 def __init__(self):
8 wx.Frame.__init__(self, None, -1, "Resizing Flex Grid Sizer")
9 sizer = wx.FlexGridSizer(rows=3, cols=3, hgap=5, vgap=5)
10 for label in labels:
11 bw = BlockWindow(self, label=label)
12 sizer.Add(bw, 0, 0)
13 center = self.FindWindowByName("five")
14 center.SetMinSize((150,50))
15 sizer.AddGrowableCol(0, 1)
16 sizer.AddGrowableCol(1, 2)
17 sizer.AddGrowableCol(2, 1)
18 sizer.AddGrowableRow(0, 1)
19 sizer.AddGrowableRow(1, 5)
20 sizer.AddGrowableRow(2, 1)
21 self.SetSizer(sizer)
22 self.Fit()
23
24app = wx.PySimpleApp()
25TestFrame().Show()
26app.MainLoop()