]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-02/dialog_scratch.py
fixed deadlock when calling wxPostEvent() from worker thread
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-02 / dialog_scratch.py
1 #!/usr/bin/env python
2
3 import wx
4 import images
5
6 class App(wx.App):
7
8 def __init__(self, redirect=True, filename=None):
9 wx.App.__init__(self, redirect, filename)
10
11 def OnInit(self):
12 dlg = wx.MessageDialog(None, 'Is this the coolest thing ever!',
13 'MessageDialog', wx.YES_NO | wx.ICON_QUESTION)
14 result = dlg.ShowModal()
15 dlg.Destroy()
16
17 dlg = wx.TextEntryDialog(None, "Who is buried in Grant's tomb?",
18 'A Question', 'Cary Grant')
19 if dlg.ShowModal() == wx.ID_OK:
20 response = dlg.GetValue()
21 dlg.Destroy()
22
23 dlg = wx.SingleChoiceDialog(None,
24 'What version of Python are you using?', 'Single Choice',
25 ['1.5.2', '2.0', '2.1.3', '2.2', '2.3.1'])
26 if dlg.ShowModal() == wx.ID_OK:
27 response = dlg.GetStringSelection()
28 dlg.Destroy()
29
30 return True
31
32
33 if __name__ == '__main__':
34 app = App(False, "output")
35 fred = app.MainLoop()
36