Sep-22-2017, 10:17 PM
In the following code when I click the 'X' on main window,
the windows are destroys, but the application keeps running.
Thought I knew how to do this, but guess not.
the windows are destroys, but the application keeps running.
Thought I knew how to do this, but guess not.
import wx
import wx
import sys
class NewPanel(wx.Panel):
def __init__(self, parent):
super(NewPanel, self).__init__(parent)
class NewFrame(wx.Frame):
def __init__(self, parent, title=""):
super(NewFrame, self).__init__(parent, title=title)
self.panel = NewPanel(self)
class DocViewer(wx.App):
def __init__(self, win_title=''):
super(DocViewer, self).__init__(win_title)
self.urls = {
'rfc_zips': 'https://www.rfc-editor.org/in-notes/tar/RFC-all.zip',
'standards_page': 'https://www.rfc-editor.org/standards'
}
self.frame = NewFrame(None, title=win_title)
self.frame.Show()
self.frame.Bind(wx.EVT_MENU, self.OnExitApp)
def OnExitApp(self, event):
self.frame.Destroy()
sys.exit(0)
if __name__ == "__main__":
app = wx.App(redirect=False)
DocViewer(win_title="RFC Viewer (c) Larz60+ 2017")
app.MainLoop()

