]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxTextEntryDialog.py
New wxDesigner-less version of the MimeTypesManager demo
[wxWidgets.git] / wxPython / demo / wxTextEntryDialog.py
... / ...
CommitLineData
1# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2#
3# o Updated for wx namespace
4#
5
6import wx
7
8#---------------------------------------------------------------------------
9
10def runTest(frame, nb, log):
11 dlg = wx.TextEntryDialog(
12 frame, 'What is your favorite programming language?',
13 'Duh??', 'Python')
14
15 dlg.SetValue("Python is the best!")
16
17 if dlg.ShowModal() == wx.ID_OK:
18 log.WriteText('You entered: %s\n' % dlg.GetValue())
19
20 dlg.Destroy()
21
22
23#---------------------------------------------------------------------------
24
25
26
27overview = """\
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.
32
33As with other dialogs of this type, the user input must be retrieved prior to
34destroying the dialog.
35
36"""
37
38
39if __name__ == '__main__':
40 import sys,os
41 import run
42 run.main(['', os.path.basename(sys.argv[0])])