]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | import wx |
2 | ||
3 | class SubclassDialog(wx.Dialog): | |
4 | def __init__(self): | |
5 | wx.Dialog.__init__(self, None, -1, 'Dialog Subclass', | |
6 | size=(300, 100)) | |
7 | okButton = wx.Button(self, wx.ID_OK, "OK", pos=(15, 15)) | |
8 | okButton.SetDefault() | |
9 | cancelButton = wx.Button(self, wx.ID_CANCEL, "Cancel", | |
10 | pos=(115, 15)) | |
11 | ||
12 | if __name__ == '__main__': | |
13 | app = wx.PySimpleApp() | |
14 | app.MainLoop() | |
15 | dialog = SubclassDialog() | |
16 | result = dialog.ShowModal() | |
17 | if result == wx.ID_OK: | |
18 | print "OK" | |
19 | else: | |
20 | print "Cancel" | |
21 | dialog.Destroy() |