]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-02/dialog_scratch.py
8 def __init__(self
, redirect
=True, filename
=None):
9 wx
.App
.__init
__(self
, redirect
, filename
)
12 dlg
= wx
.MessageDialog(None, 'Is this the coolest thing ever!',
13 'MessageDialog', wx
.YES_NO | wx
.ICON_QUESTION
)
14 result
= dlg
.ShowModal()
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()
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()
33 if __name__
== '__main__':
34 app
= App(False, "output")