- EVT_BUTTON(self, b.GetId(), self.OnButton)
- b = wxButton(self, -1, "non-default", (140, 10))
- EVT_BUTTON(self, b.GetId(), self.OnButton)
- #wxTextCtrl(self, -1, "", (10,40))
-
- b = wxGenButton(self, -1, 'Hello', (10,65))
- EVT_BUTTON(self, b.GetId(), self.OnButton)
- b = wxGenButton(self, -1, 'disabled', (140,65))
- EVT_BUTTON(self, b.GetId(), self.OnButton)
- b.Enable(false)
-
- b = wxGenButton(self, -1, 'bigger', (250,50))
- EVT_BUTTON(self, b.GetId(), self.OnButton)
- b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false))
+ self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId())
+ sizer.Add(b)
+
+ # Same thing, but NOT set as the default button
+ b = wx.Button(self, -1, "non-default")
+ self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId())
+ sizer.Add(b)
+ sizer.Add((10,10))
+
+ # Plain old text button based off GenButton()
+ b = buttons.GenButton(self, -1, 'Hello')
+ self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId())
+ sizer.Add(b)
+
+ # Plain old text button, disabled.
+ b = buttons.GenButton(self, -1, 'disabled')
+ self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId())
+ b.Enable(False)
+ sizer.Add(b)
+
+ # This time, we let the botton be as big as it can be.
+ # Also, this one is fancier, with custom colors and bezel size.
+ b = buttons.GenButton(self, -1, 'bigger')
+ self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, id=b.GetId())
+ b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False))