Frame(parent, id=ID_ANY, title="", pos=DefaultPosition,
size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
Вы пропустили родительский аргумент.
Рабочий код
import wx
class MainWindow(wx.Frame):
def __init__(self):
wx.Frame.__init__(
self, None, wx.ID_ANY, "Title", wx.DefaultPosition, (350,200),
wx.DEFAULT_FRAME_STYLE, wx.FrameNameStr)
self.Bind(wx.EVT_CLOSE, self.OnClose)
menuBar = wx.MenuBar()
menu = wx.Menu()
m_exit = menu.Append(
wx.ID_EXIT, "E&xit", "Close window and exit program.")
self.Bind(wx.EVT_MENU, self.OnClose, m_exit)
menuBar.Append(menu, "&File")
menu = wx.Menu()
m_about = menu.Append(
wx.ID_ABOUT, "&About", "Information about this program")
self.Bind(wx.EVT_MENU, self.OnAbout, m_about)
menuBar.Append(menu, "&Help")
self.SetMenuBar(menuBar)
self.main_panel = MainPanel(self)
def OnClose(self, e):
self.Destroy()
def OnAbout(self, event):
dlg = AboutBox(self)
dlg.ShowModal()
dlg.Destroy()
class MainPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
class AboutBox(wx.MessageDialog):
def __init__(self, parent):
wx.MessageDialog.__init__(
self, parent, "About", "About", wx.OK | wx.ICON_INFORMATION,
pos=wx.DefaultPosition)
self.CentreOnParent(wx.BOTH)
if __name__ == "__main__":
app = wx.App(False)
frame = MainWindow()
frame.Show()
app.MainLoop()