]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-11/resizegridsizer.py
fix building/running of tex2rtf
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-11 / resizegridsizer.py
1 import wx
2 from blockwindow import BlockWindow
3
4 labels = "one two three four five six seven eight nine".split()
5 flags = {"one": wx.ALIGN_BOTTOM, "two": wx.ALIGN_CENTER,
6 "four": wx.ALIGN_RIGHT, "six": wx.EXPAND, "seven": wx.EXPAND,
7 "eight": wx.SHAPED}
8
9 class TestFrame(wx.Frame):
10 def __init__(self):
11 wx.Frame.__init__(self, None, -1, "GridSizer Resizing")
12 sizer = wx.GridSizer(rows=3, cols=3, hgap=5, vgap=5)
13 for label in labels:
14 bw = BlockWindow(self, label=label)
15 flag = flags.get(label, 0)
16 sizer.Add(bw, 0, flag)
17 self.SetSizer(sizer)
18 self.Fit()
19
20 app = wx.PySimpleApp()
21 TestFrame().Show()
22 app.MainLoop()