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