]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-11/basicflexgridsizer.py
don't use strlen() to verify the length of the string as it can contain embedded...
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-11 / basicflexgridsizer.py
1 import wx
2 from blockwindow import BlockWindow
3
4 labels = "one two three four five six seven eight nine".split()
5
6 class TestFrame(wx.Frame):
7 def __init__(self):
8 wx.Frame.__init__(self, None, -1, "FlexGridSizer")
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 self.SetSizer(sizer)
16 self.Fit()
17
18 app = wx.PySimpleApp()
19 TestFrame().Show()
20 app.MainLoop()