Creates a wx.App instance if it has not been created sofar.

def _create_wx_app():
    """
    Creates a wx.App instance if it has not been created sofar.
    """
    wxapp = wx.GetApp()
    if wxapp is None:
        wxapp = wx.App(False)
        wxapp.SetExitOnFrameDelete(True)
        # retain a reference to the app object so it does not get garbage
        # collected and cause segmentation faults
        _create_wx_app.theWxApp = wxapp