Added the sample code from wxPython In Action to the samples dir
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
25
wxPython/samples/wxPIA_book/Chapter-07/text_ctrl.py
Normal file
25
wxPython/samples/wxPIA_book/Chapter-07/text_ctrl.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import wx
|
||||
|
||||
class TextFrame(wx.Frame):
|
||||
|
||||
def __init__(self):
|
||||
wx.Frame.__init__(self, None, -1, 'Text Entry Example',
|
||||
size=(300, 100))
|
||||
panel = wx.Panel(self, -1)
|
||||
basicLabel = wx.StaticText(panel, -1, "Basic Control:")
|
||||
basicText = wx.TextCtrl(panel, -1, "I've entered some text!",
|
||||
size=(175, -1))
|
||||
basicText.SetInsertionPoint(0)
|
||||
|
||||
pwdLabel = wx.StaticText(panel, -1, "Password:")
|
||||
pwdText = wx.TextCtrl(panel, -1, "password", size=(175, -1),
|
||||
style=wx.TE_PASSWORD)
|
||||
sizer = wx.FlexGridSizer(cols=2, hgap=6, vgap=6)
|
||||
sizer.AddMany([basicLabel, basicText, pwdLabel, pwdText])
|
||||
panel.SetSizer(sizer)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = wx.PySimpleApp()
|
||||
frame = TextFrame()
|
||||
frame.Show()
|
||||
app.MainLoop()
|
Reference in New Issue
Block a user