Hi,
My GUI keeps crashing on the second time it runs. It doesn't come up with any useful error messages, just says "there was a problem". I've narrowed the offending code to the following.
I'm running wxpython on windows xp.
cheers
[CODE=python]
import wx
class myFrame(wx.Fram e):
def __init__(self, parent, id, title):
wx.Frame.__init __(self, parent, id, title, size=(250, 150))
menubar = wx.MenuBar()
file = wx.Menu()
quit = wx.MenuItem(fil e, 1, '&Quit\tCtrl+Q' )
file.AppendItem (quit)
self.Bind(wx.EV T_MENU, self.OnQuit, id=1)
menubar.Append( file, '&File')
self.SetMenuBar (menubar)
self.Centre()
self.Show(True)
def OnQuit(self, event):
self.Close()
class MyApp(wx.App):
def OnInit(self):
frame =myFrame(None,-1,"frame test")
self.SetTopWind ow(frame)
print "Print statements go to this stdout window by default."
frame.Show(True )
return True
app = MyApp(False)
app.MainLoop()
[/CODE]
My GUI keeps crashing on the second time it runs. It doesn't come up with any useful error messages, just says "there was a problem". I've narrowed the offending code to the following.
I'm running wxpython on windows xp.
cheers
[CODE=python]
import wx
class myFrame(wx.Fram e):
def __init__(self, parent, id, title):
wx.Frame.__init __(self, parent, id, title, size=(250, 150))
menubar = wx.MenuBar()
file = wx.Menu()
quit = wx.MenuItem(fil e, 1, '&Quit\tCtrl+Q' )
file.AppendItem (quit)
self.Bind(wx.EV T_MENU, self.OnQuit, id=1)
menubar.Append( file, '&File')
self.SetMenuBar (menubar)
self.Centre()
self.Show(True)
def OnQuit(self, event):
self.Close()
class MyApp(wx.App):
def OnInit(self):
frame =myFrame(None,-1,"frame test")
self.SetTopWind ow(frame)
print "Print statements go to this stdout window by default."
frame.Show(True )
return True
app = MyApp(False)
app.MainLoop()
[/CODE]
Comment