[Python] 纯文本查看 复制代码
class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title='', size=(329, 190),name='frame',style=541072960)
self.启动窗口 = wx.Panel(self)
self.Centre()
self.编辑框1 = wx.TextCtrl(self.启动窗口,size=(109, 22),pos=(71, 21),value='',name='text',style=0)
self.编辑框2 = wx.TextCtrl(self.启动窗口,size=(109, 22),pos=(70, 55),value='',name='text',style=2048)
self.标签1 = wx.StaticText(self.启动窗口,size=(52, 24),pos=(8, 24),label='账户',name='staticText',style=2321)
self.标签2 = wx.StaticText(self.启动窗口,size=(55, 24),pos=(8, 59),label='密码',name='staticText',style=2321)
self.按钮2 = wx.Button(self.启动窗口,size=(80, 32),pos=(214, 35),label='按钮',name='button')
self.按钮2.Bind(wx.EVT_BUTTON,self.按钮2_按钮被单击)
self.单选框1 = wx.RadioButton(self.启动窗口,size=(80, 24),pos=(17, 111),name='600',label='10分钟')
self.单选框1.SetValue(True)
self.单选框2 = wx.RadioButton(self.启动窗口,size=(80, 24),pos=(108, 111),name='1800',label='30分钟')
self.单选框3 = wx.RadioButton(self.启动窗口,size=(80, 24),pos=(192, 111),name='3600',label='60分钟')
self.单选框1.Bind(wx.EVT_RADIOBUTTON,self.radioEvent)
self.单选框2.Bind(wx.EVT_RADIOBUTTON,self.radioEvent)
self.单选框3.Bind(wx.EVT_RADIOBUTTON,self.radioEvent)
def radioEvent(self, event):
t = int(event.GetEventObject().Name)
print(t)
class myApp(wx.App):
def OnInit(self):
self.frame = Frame()
self.frame.Show(True)
return True
if __name__ == '__main__':
app = myApp()
app.MainLoop()