TypeError: OnExit() takes exactly 2 arguments (1 given)

hi

I've got error while exiting program:
TypeError: OnExit() takes exactly 2 arguments (1 given)

EVT_MENU(self.frame, XRCID("ExitMI"), self.OnExit)
def OnExit(self, event):
  self.frame.Close(True)

Why can I get this error, may be wxPython does not send event to event
handler?

···

--
WBR, sector119

sector119@mail.ru wrote:

hi

I've got error while exiting program:
TypeError: OnExit() takes exactly 2 arguments (1 given)

EVT_MENU(self.frame, XRCID("ExitMI"), self.OnExit)
def OnExit(self, event):
  self.frame.Close(True)

Why can I get this error, may be wxPython does not send event to event
handler?

If self is your App class then OnExit is a method overridden from the base class (similar to OnInit) and it is called by the framework when the App is exiting. Try changing the name of your event handler method to OnExitApp or something.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!