事件
发表在Python图书答疑
2019-07-13 悬赏:2 学分
《Python从入门到项目实践》第19章 常用的GUI框架 297页-298页
是否精华
是
否
版块置顶:
是
否
wx gui(wx.Frame): (, parent, id): wx.Frame.(, parent, id, =, =(, )) panel = wx.Panel() .用户名 = wx.StaticText(panel, =) .用户名1 = wx.TextCtrl(panel) .密码 = wx.StaticText(panel, =) .密码1 = wx.TextCtrl(panel, =wx.TE_PASSWORD) .说明 = wx.StaticText(panel, =) .按钮 = wx.Button(panel, =) .按钮.Bind(, .确定) .按钮1 = wx.Button(panel, =) .按钮1.Bind(, .取消) box = wx.BoxSizer() box.Add(.用户名, =, =wx.ALL | wx.ALIGN_LEFT, =) box.Add(.用户名1, =, =wx.ALL | wx.ALIGN_LEFT, =) box1 = wx.BoxSizer() box1.Add(.密码, =, =wx.ALL, =) box1.Add(.密码1, =, =wx.ALL, =) box2 = wx.BoxSizer() box2.Add(.按钮, =) box2.Add(.按钮1, =) box3 = wx.BoxSizer(wx.VERTICAL) box3.Add(.说明, =, =wx.LEFT , =) box3.Add(box, =, =wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, =) box3.Add(box1, =, =wx.LEFT | wx.RIGHT | wx.TOP | wx.EXPAND, =) box3.Add(box2, =, =wx.TOP | wx.ALIGN_CENTER, =) panel.SetSizer(box3) 确定(,):
a = .用户名1.GetValue() b = .密码1.GetValue() a == b == : message = a == b == : message = : message = wx.MessageBox(message) 取消(, ): .用户名1.SetValue() .密码1.SetValue() __name__ == : app = wx.App() Frame = gui(, -) Frame.Show() app.MainLoop() 加下划线的a是否代表那个加下划线的事件