- wxPanel.__init__(self, parent, -1)
- self.SetAutoLayout(true)
- EVT_BUTTON(self, 100, self.OnButton)
-
- self.SetBackgroundColour(wxNamedColour("MEDIUM ORCHID"))
-
- self.panelA = wxWindow(self, -1, wxDefaultPosition, wxDefaultSize,
- wxSIMPLE_BORDER)
- self.panelA.SetBackgroundColour(wxBLUE)
- txt = wxStaticText(self.panelA, -1,
- "Resize the window and see\n"
- "what happens... Notice that\n"
- "there is no OnSize handler.",
- wxPoint(5,5), wxSize(-1, 50))
- txt.SetBackgroundColour(wxBLUE)
- txt.SetForegroundColour(wxWHITE)
-
- lc = wxLayoutConstraints()
- lc.top.SameAs(self, wxTop, 10)
- lc.left.SameAs(self, wxLeft, 10)
- lc.bottom.SameAs(self, wxBottom, 10)
- lc.right.PercentOf(self, wxRight, 50)
+ wx.Panel.__init__(self, parent, -1)
+ self.SetAutoLayout(True)
+ self.Bind(wx.EVT_BUTTON, self.OnButton, id=100)
+
+ self.SetBackgroundColour(wx.NamedColour("MEDIUM ORCHID"))
+
+ self.panelA = wx.Window(self, -1, style=wx.SIMPLE_BORDER)
+ self.panelA.SetBackgroundColour(wx.BLUE)
+
+ txt = wx.StaticText(
+ self.panelA, -1,
+ "Resize the window and see\n"
+ "what happens... Notice that\n"
+ "there is no OnSize handler.",
+ (5,5), (-1, 50)
+ )
+
+ txt.SetBackgroundColour(wx.BLUE)
+ txt.SetForegroundColour(wx.WHITE)
+
+ lc = wx.LayoutConstraints()
+ lc.top.SameAs(self, wx.Top, 10)
+ lc.left.SameAs(self, wx.Left, 10)
+ lc.bottom.SameAs(self, wx.Bottom, 10)
+ lc.right.PercentOf(self, wx.Right, 50)