def makeBoxInBox(win):
box = wxBoxSizer(wxVERTICAL)
- btn = wxButton(win, 1010, "one")
- box.Add(btn)
+ box.Add(wxButton(win, 1010, "one"))
box2 = wxBoxSizer(wxHORIZONTAL)
- btn = wxButton(win, 1010, "two")
- box2.Add(btn)
- btn = wxButton(win, 1010, "three")
- box2.Add(btn)
- btn = wxButton(win, 1010, "four")
- box2.Add(btn)
- btn = wxButton(win, 1010, "five")
- box2.Add(btn)
+ box2.AddMany([ wxButton(win, 1010, "two"),
+ wxButton(win, 1010, "three"),
+ wxButton(win, 1010, "four"),
+ wxButton(win, 1010, "five"),
+ ])
box3 = wxBoxSizer(wxVERTICAL)
- box3.AddMany([ (wxButton(win, 1010, "six"), 1),
+ box3.AddMany([ (wxButton(win, 1010, "six"), 0),
(wxButton(win, 1010, "seven"), 2),
(wxButton(win, 1010, "eight"), 1),
(wxButton(win, 1010, "nine"), 1),
box2.Add(box3, 1)
box.Add(box2, 1)
- btn = wxButton(win, 1010, "ten")
- box.Add(btn)
+ box.Add(wxButton(win, 1010, "ten"))
return box
def makeBorderInBox(win):
insideBox = wxBoxSizer(wxHORIZONTAL)
- insideBox.Add(makeSimpleBox3(win), 1)
+
+ box2 = wxBoxSizer(wxHORIZONTAL)
+ box2.AddMany([ wxButton(win, 1010, "one"),
+ wxButton(win, 1010, "two"),
+ wxButton(win, 1010, "three"),
+ wxButton(win, 1010, "four"),
+ wxButton(win, 1010, "five"),
+ ])
+
+ insideBox.Add(box2, 0)
bdr = wxBorderSizer(wxALL)
bdr.Add(wxButton(win, 1010, "border"), 20)
insideBox.Add(bdr, 1)
box3 = wxBoxSizer(wxVERTICAL)
- box3.AddMany([ (wxButton(win, 1010, "six"), 1),
+ box3.AddMany([ (wxButton(win, 1010, "six"), 0),
(wxButton(win, 1010, "seven"), 2),
(wxButton(win, 1010, "eight"), 1),
(wxButton(win, 1010, "nine"), 1),
- ])
+ ])
insideBox.Add(box3, 1)
outsideBox = wxBoxSizer(wxVERTICAL)
),
("Border in a Box", makeBorderInBox,
- ""
+ "Another nesting example. This one has Boxes and a Border inside another Box."
),
]
self.sizer = sizerFunc(self)
self.CreateStatusBar()
-
+ self.SetStatusText("Resize this frame to see how the sizers respond...")
self.sizer.FitWindow(self)
-
def OnSize(self, event):
size = self.GetClientSize()
self.sizer.Layout(size)