Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- import wx
- class ButtonFrame(wx.Frame):
- def __init__(self):
- wx.Frame.__init__(self, None, -1, 'Button Example',
- size=(300, 100))
- panel = wx.Panel(self, -1)
- self.button = wx.Button(panel, -1, "Hello", pos=(50, 20))
- self.Bind(wx.EVT_BUTTON, self.OnClick, self.button)
- self.button.SetDefault()
- def OnClick(self, event):
- self.button.SetLabel("Clicked")
Add Comment
Please, Sign In to add comment