]> git.saurik.com Git - wxWidgets.git/blame - wxPython/samples/wxPIA_book/Chapter-09/modal_dialog.py
fix building/running of tex2rtf
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-09 / modal_dialog.py
CommitLineData
be05b434
RD
1import wx
2
3class 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
12if __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()