]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/TextEntryDialog.py
Script updates
[wxWidgets.git] / wxPython / demo / TextEntryDialog.py
CommitLineData
cf694132 1
8fa876ca 2import wx
cf694132
RD
3
4#---------------------------------------------------------------------------
5
6def runTest(frame, nb, log):
8fa876ca
RD
7 dlg = wx.TextEntryDialog(
8 frame, 'What is your favorite programming language?',
95bfd958 9 'Eh??', 'Python')
8fa876ca 10
a1bfae9d 11 dlg.SetValue("Python is the best!")
8fa876ca
RD
12
13 if dlg.ShowModal() == wx.ID_OK:
cf694132 14 log.WriteText('You entered: %s\n' % dlg.GetValue())
8fa876ca 15
cf694132
RD
16 dlg.Destroy()
17
18
19#---------------------------------------------------------------------------
20
21
22
1fded56b 23overview = """\
8fa876ca 24This class represents a dialog that requests a one-line text string from the user.
95bfd958
RD
25It is implemented as a generic wxWindows dialog. Along with the usual wx.Dialog
26style flags, all of the wx.TextCtrl TE_* style flags are accepted, so, for example,
8fa876ca 27wx.TE_PASSWORD could be used to create a password dialog.
cf694132 28
8fa876ca
RD
29As with other dialogs of this type, the user input must be retrieved prior to
30destroying the dialog.
cf694132 31
8fa876ca 32"""
cf694132
RD
33
34
1fded56b
RD
35if __name__ == '__main__':
36 import sys,os
37 import run
38 run.main(['', os.path.basename(sys.argv[0])])