0
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()

我想做的是,当您从菜单项中按退出时。它关闭了整个程序,但目前它似乎没有做任何事情。我如何编辑我的代码以关闭整个程序

4

1 回答 1

0

@0x00mh 在评论中解决了这个问题 self.frame.Close()

于 2013-05-05T14:35:43.500 回答