mport wxclass MyFrame(wx.Frame):def __init__(self, parent, id):wx.Frame.__init__(self, parent, id, u'测试面板duPanel', size = ())#创建面板panel = wx.Panel(self)#在Panel上添加Buttonbutton = wx.Button(panel, label = u'关闭'洞腊, pos = (, ), size = (, ))#绑定单信颤薯击事件self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)def OnCloseMe(self, event):dlg = wx.MessageDialog(None, u"消息对话框测试", u"标滑者题信息", wx.YES_NO wx.ICON_QUESTION)if dlg.ShowModal() == wx.ID_YES:self.Close(True)dlg.Destroy()if __name__ == '__main__':app = wx.PySimpleApp()frame = MyFrame(parent = None, id = -)frame.Show()app.MainLoop()