When you click on Cancel, it cancels… When you click OK, it pops the dialog back on. How can I fix this?
def quitApp(self, event):
dial = wx.MessageDialog(None, 'Are you sure you want to quit?','Quit', wxYES | wxNO)
if dial.ShowModal() == wxID_YES:
self.Close(true)
Could it be that quitApp is called by the system CloseEvent handler? In that case, self.Close(true) only triggers a new CloseEvent, which in that case will call quitApp again and show a new dialog… and so on.
I suggest you quit the application with sys.exit(0) instead of self.Close(true).