]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-07/text_ctrl.py
don't use strlen() to verify the length of the string as it can contain embedded...
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-07 / text_ctrl.py
1 import wx
2
3 class TextFrame(wx.Frame):
4
5 def __init__(self):
6 wx.Frame.__init__(self, None, -1, 'Text Entry Example',
7 size=(300, 100))
8 panel = wx.Panel(self, -1)
9 basicLabel = wx.StaticText(panel, -1, "Basic Control:")
10 basicText = wx.TextCtrl(panel, -1, "I've entered some text!",
11 size=(175, -1))
12 basicText.SetInsertionPoint(0)
13
14 pwdLabel = wx.StaticText(panel, -1, "Password:")
15 pwdText = wx.TextCtrl(panel, -1, "password", size=(175, -1),
16 style=wx.TE_PASSWORD)
17 sizer = wx.FlexGridSizer(cols=2, hgap=6, vgap=6)
18 sizer.AddMany([basicLabel, basicText, pwdLabel, pwdText])
19 panel.SetSizer(sizer)
20
21 if __name__ == '__main__':
22 app = wx.PySimpleApp()
23 frame = TextFrame()
24 frame.Show()
25 app.MainLoop()