class MainPanel(wx.Panel):##main frame
""""""
#----------------------------------------------------------------------
def __init__(self, parent, size = (5000,5000)):
"""Constructor"""
wx.Panel.__init__(self, parent=parent, size = (5000,5000))
self.frame = parent
Publisher().subscribe(self.showFrame, ("show.mainframe"))
##create menubar
menu=wx.MenuBar()
file0 = wx.Menu()
help0 = wx.Menu()
rules = wx.Menu()
Closed = file0.Append(wx.NewId(),"Quit")
parent.Bind(wx.EVT_MENU,self.close,Closed)
def close(self,event):
self.Close()
当我从菜单项中按退出时,我想要做的是。它关闭了整个程序,但目前它似乎没有做任何事情。 如何编辑我的代码以便关闭整个程序
答案 0 :(得分:0)
@ 0x00mh在评论中解决了这个问题
self.frame.Close()