]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | import wx |
2 | ||
3 | class ButtonFrame(wx.Frame): | |
4 | def __init__(self): | |
5 | wx.Frame.__init__(self, None, -1, 'Button Example', | |
6 | size=(300, 100)) | |
7 | panel = wx.Panel(self, -1) | |
8 | self.button = wx.Button(panel, -1, "Hello", pos=(50, 20)) | |
9 | self.Bind(wx.EVT_BUTTON, self.OnClick, self.button) | |
10 | self.button.SetDefault() | |
11 | ||
12 | def OnClick(self, event): | |
13 | self.button.SetLabel("Clicked") | |
14 | ||
15 | if __name__ == '__main__': | |
16 | app = wx.PySimpleApp() | |
17 | frame = ButtonFrame() | |
18 | frame.Show() | |
19 | app.MainLoop() | |
20 | ||
21 |