SHARE
TWEET

Catch MainLoop exceptions and displaying them in MessageDialogs

a guest Feb 27th, 2012 10 Never
  1. if __name__ == '__main__':
  2.     app = MyApp(0)
  3.     try:
  4.         MainWindow(None, -1, 'My Cool App')
  5.         app.MainLoop()
  6.     except ConfigParser.Error, error_message:
  7.         messagebox = wx.MessageDialog(None, error_message, 'Configuration Error', wx.OK | wx.ICON_ERROR)
  8.         messagebox.ShowModal()
RAW Paste Data
Top