]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/TextEntryDialog.py
Renamed demo modules to be wx-less.
[wxWidgets.git] / wxPython / demo / TextEntryDialog.py
1 # 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2 #
3 # o Updated for wx namespace
4 #
5
6 import wx
7
8 #---------------------------------------------------------------------------
9
10 def 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
27 overview = """\
28 This class represents a dialog that requests a one-line text string from the user.
29 It is implemented as a generic wxWindows dialog. Along with the usual wxDialog
30 style flags, all of the wxTextCtrl TE_* style flags are accepted, so, for example,
31 wx.TE_PASSWORD could be used to create a password dialog.
32
33 As with other dialogs of this type, the user input must be retrieved prior to
34 destroying the dialog.
35
36 """
37
38
39 if __name__ == '__main__':
40 import sys,os
41 import run
42 run.main(['', os.path.basename(sys.argv[0])])