]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_misc_wrap.cpp
test wxString's char<->wchar_t ctors
[wxWidgets.git] / wxPython / src / gtk / _misc_wrap.cpp
index a6589a0d2801b76cea664823d3cc482425a33069..4c9ab5d3dea4bee837b3605661d4d2ad039bac17 100644 (file)
@@ -348,8 +348,7 @@ static swig_type_info *swig_types[86];
 
 #include "wx/wxPython/wxPython.h"
 #include "wx/wxPython/pyclasses.h"
 
 #include "wx/wxPython/wxPython.h"
 #include "wx/wxPython/pyclasses.h"
-#include "wx/wxPython/pyistream.h"
-    
+#include "wx/wxPython/pyistream.h"    
 
  static const wxString wxPyEmptyString(wxEmptyString); 
 
 
  static const wxString wxPyEmptyString(wxEmptyString); 
 
@@ -1596,11 +1595,12 @@ static PyObject *_wrap_SystemSettings_GetColour(PyObject *self, PyObject *args,
     arg1 = (wxSystemColour) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxSystemColour) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxSystemSettings::GetColour((wxSystemColour )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxSystemSettings::GetColour((wxSystemColour )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxColour * resultptr;
     }
     {
         wxColour * resultptr;
@@ -1626,11 +1626,12 @@ static PyObject *_wrap_SystemSettings_GetFont(PyObject *self, PyObject *args, Py
     arg1 = (wxSystemFont) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxSystemFont) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxSystemSettings::GetFont((wxSystemFont )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxSystemSettings::GetFont((wxSystemFont )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxFont * resultptr;
     }
     {
         wxFont * resultptr;
@@ -1656,11 +1657,12 @@ static PyObject *_wrap_SystemSettings_GetMetric(PyObject *self, PyObject *args,
     arg1 = (wxSystemMetric) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxSystemMetric) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxSystemSettings::GetMetric((wxSystemMetric )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxSystemSettings::GetMetric((wxSystemMetric )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
@@ -1682,11 +1684,12 @@ static PyObject *_wrap_SystemSettings_HasFeature(PyObject *self, PyObject *args,
     arg1 = (wxSystemFeature) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxSystemFeature) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxSystemSettings::HasFeature((wxSystemFeature )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxSystemSettings::HasFeature((wxSystemFeature )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -1706,11 +1709,12 @@ static PyObject *_wrap_SystemSettings_GetScreenType(PyObject *self, PyObject *ar
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":SystemSettings_GetScreenType",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":SystemSettings_GetScreenType",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxSystemSettings::GetScreenType();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxSystemSettings::GetScreenType();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
@@ -1731,11 +1735,12 @@ static PyObject *_wrap_SystemSettings_SetScreenType(PyObject *self, PyObject *ar
     arg1 = (wxSystemScreenType) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxSystemScreenType) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxSystemSettings::SetScreenType((wxSystemScreenType )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxSystemSettings::SetScreenType((wxSystemScreenType )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -2133,11 +2138,12 @@ static PyObject *_wrap_Bell(PyObject *self, PyObject *args, PyObject *kwargs) {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":Bell",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":Bell",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxBell();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxBell();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -2154,11 +2160,12 @@ static PyObject *_wrap_EndBusyCursor(PyObject *self, PyObject *args, PyObject *k
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":EndBusyCursor",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":EndBusyCursor",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxEndBusyCursor();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxEndBusyCursor();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -2209,11 +2216,12 @@ static PyObject *_wrap_GetMousePosition(PyObject *self, PyObject *args, PyObject
     arg2 = &temp2;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetMousePosition",kwnames)) goto fail;
     {
     arg2 = &temp2;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetMousePosition",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxGetMousePosition(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxGetMousePosition(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
@@ -2445,11 +2453,12 @@ static PyObject *_wrap_Shutdown(PyObject *self, PyObject *args, PyObject *kwargs
     arg1 = (wxShutdownFlags) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxShutdownFlags) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxShutdown((wxShutdownFlags )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxShutdown((wxShutdownFlags )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -2925,11 +2934,12 @@ static PyObject *_wrap_FileSelector(PyObject *self, PyObject *args, PyObject *kw
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxFileSelector((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,(wxString const &)*arg4,(wxString const &)*arg5,arg6,arg7,arg8,arg9);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxFileSelector((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,(wxString const &)*arg4,(wxString const &)*arg5,arg6,arg7,arg8,arg9);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3026,11 +3036,12 @@ static PyObject *_wrap_LoadFileSelector(PyObject *self, PyObject *args, PyObject
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxLoadFileSelector((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxLoadFileSelector((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3111,11 +3122,12 @@ static PyObject *_wrap_SaveFileSelector(PyObject *self, PyObject *args, PyObject
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxSaveFileSelector((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxSaveFileSelector((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3207,11 +3219,12 @@ static PyObject *_wrap_DirSelector(PyObject *self, PyObject *args, PyObject *kwa
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxDirSelector((wxString const &)*arg1,(wxString const &)*arg2,arg3,(wxPoint const &)*arg4,arg5);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxDirSelector((wxString const &)*arg1,(wxString const &)*arg2,arg3,(wxPoint const &)*arg4,arg5);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3305,11 +3318,12 @@ static PyObject *_wrap_GetTextFromUser(PyObject *self, PyObject *args, PyObject
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetTextFromUser((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4,arg5,arg6,arg7);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetTextFromUser((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4,arg5,arg6,arg7);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3393,11 +3407,12 @@ static PyObject *_wrap_GetPasswordFromUser(PyObject *self, PyObject *args, PyObj
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetPasswordFromUser((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetPasswordFromUser((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3505,11 +3520,12 @@ static PyObject *_wrap_GetSingleChoice(PyObject *self, PyObject *args, PyObject
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetSingleChoice((wxString const &)*arg1,(wxString const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetSingleChoice((wxString const &)*arg1,(wxString const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
 #if wxUSE_UNICODE
     }
     {
 #if wxUSE_UNICODE
@@ -3615,11 +3631,12 @@ static PyObject *_wrap_GetSingleChoiceIndex(PyObject *self, PyObject *args, PyOb
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxGetSingleChoiceIndex((wxString const &)*arg1,(wxString const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxGetSingleChoiceIndex((wxString const &)*arg1,(wxString const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromInt((int)result);
     {
     }
     resultobj = SWIG_FromInt((int)result);
     {
@@ -3702,11 +3719,12 @@ static PyObject *_wrap_MessageBox(PyObject *self, PyObject *args, PyObject *kwar
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxMessageBox((wxString const &)*arg1,(wxString const &)*arg2,arg3,arg4,arg5,arg6);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxMessageBox((wxString const &)*arg1,(wxString const &)*arg2,arg3,arg4,arg5,arg6);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromInt((int)result);
     {
     }
     resultobj = SWIG_FromInt((int)result);
     {
@@ -3796,11 +3814,12 @@ static PyObject *_wrap_GetNumberFromUser(PyObject *self, PyObject *args, PyObjec
         }
     }
     {
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (long)wxGetNumberFromUser((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4,arg5,arg6,arg7,(wxPoint const &)*arg8);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (long)wxGetNumberFromUser((wxString const &)*arg1,(wxString const &)*arg2,(wxString const &)*arg3,arg4,arg5,arg6,arg7,(wxPoint const &)*arg8);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromLong((long)result);
     {
     }
     resultobj = SWIG_FromLong((long)result);
     {
@@ -3842,11 +3861,12 @@ static PyObject *_wrap_ColourDisplay(PyObject *self, PyObject *args, PyObject *k
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":ColourDisplay",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":ColourDisplay",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxColourDisplay();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxColourDisplay();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -3866,11 +3886,12 @@ static PyObject *_wrap_DisplayDepth(PyObject *self, PyObject *args, PyObject *kw
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DisplayDepth",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DisplayDepth",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxDisplayDepth();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxDisplayDepth();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
@@ -3888,11 +3909,12 @@ static PyObject *_wrap_GetDisplayDepth(PyObject *self, PyObject *args, PyObject
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDisplayDepth",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDisplayDepth",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxGetDisplayDepth();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (int)wxGetDisplayDepth();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
     }
     resultobj = SWIG_FromInt((int)result);
     return resultobj;
@@ -3915,11 +3937,12 @@ static PyObject *_wrap_DisplaySize(PyObject *self, PyObject *args, PyObject *kwa
     arg2 = &temp2;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DisplaySize",kwnames)) goto fail;
     {
     arg2 = &temp2;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DisplaySize",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxDisplaySize(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxDisplaySize(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
@@ -3945,11 +3968,12 @@ static PyObject *_wrap_GetDisplaySize(PyObject *self, PyObject *args, PyObject *
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDisplaySize",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDisplaySize",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetDisplaySize();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetDisplaySize();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxSize * resultptr;
     }
     {
         wxSize * resultptr;
@@ -3976,11 +4000,12 @@ static PyObject *_wrap_DisplaySizeMM(PyObject *self, PyObject *args, PyObject *k
     arg2 = &temp2;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DisplaySizeMM",kwnames)) goto fail;
     {
     arg2 = &temp2;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":DisplaySizeMM",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxDisplaySizeMM(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxDisplaySizeMM(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
@@ -4006,11 +4031,12 @@ static PyObject *_wrap_GetDisplaySizeMM(PyObject *self, PyObject *args, PyObject
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDisplaySizeMM",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetDisplaySizeMM",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetDisplaySizeMM();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetDisplaySizeMM();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxSize * resultptr;
     }
     {
         wxSize * resultptr;
@@ -4043,11 +4069,12 @@ static PyObject *_wrap_ClientDisplayRect(PyObject *self, PyObject *args, PyObjec
     arg4 = &temp4;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":ClientDisplayRect",kwnames)) goto fail;
     {
     arg4 = &temp4;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":ClientDisplayRect",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxClientDisplayRect(arg1,arg2,arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxClientDisplayRect(arg1,arg2,arg3,arg4);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     {
@@ -4081,11 +4108,12 @@ static PyObject *_wrap_GetClientDisplayRect(PyObject *self, PyObject *args, PyOb
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetClientDisplayRect",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetClientDisplayRect",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetClientDisplayRect();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxGetClientDisplayRect();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxRect * resultptr;
     }
     {
         wxRect * resultptr;
@@ -4115,11 +4143,12 @@ static PyObject *_wrap_SetCursor(PyObject *self, PyObject *args, PyObject *kwarg
         SWIG_fail;
     }
     {
         SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxSetCursor(*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxSetCursor(*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -4142,11 +4171,12 @@ static PyObject *_wrap_BeginBusyCursor(PyObject *self, PyObject *args, PyObject
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxBeginBusyCursor(arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxBeginBusyCursor(arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -4164,11 +4194,12 @@ static PyObject *_wrap_GetActiveWindow(PyObject *self, PyObject *args, PyObject
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetActiveWindow",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetActiveWindow",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxGetActiveWindow();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxGetActiveWindow();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = wxPyMake_wxObject(result); 
     }
     {
         resultobj = wxPyMake_wxObject(result); 
@@ -4195,11 +4226,12 @@ static PyObject *_wrap_GenericFindWindowAtPoint(PyObject *self, PyObject *args,
         if ( ! wxPoint_helper(obj0, &arg1)) SWIG_fail;
     }
     {
         if ( ! wxPoint_helper(obj0, &arg1)) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxGenericFindWindowAtPoint((wxPoint const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxGenericFindWindowAtPoint((wxPoint const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = wxPyMake_wxObject(result); 
     }
     {
         resultobj = wxPyMake_wxObject(result); 
@@ -4226,11 +4258,12 @@ static PyObject *_wrap_FindWindowAtPoint(PyObject *self, PyObject *args, PyObjec
         if ( ! wxPoint_helper(obj0, &arg1)) SWIG_fail;
     }
     {
         if ( ! wxPoint_helper(obj0, &arg1)) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxFindWindowAtPoint((wxPoint const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxFindWindowAtPoint((wxPoint const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = wxPyMake_wxObject(result); 
     }
     {
         resultobj = wxPyMake_wxObject(result); 
@@ -4254,11 +4287,12 @@ static PyObject *_wrap_GetTopLevelParent(PyObject *self, PyObject *args, PyObjec
     if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
     SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     {
     if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
     SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxGetTopLevelParent(arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindow *)wxGetTopLevelParent(arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = wxPyMake_wxObject(result); 
     }
     {
         resultobj = wxPyMake_wxObject(result); 
@@ -4282,11 +4316,12 @@ static PyObject *_wrap_GetKeyState(PyObject *self, PyObject *args, PyObject *kwa
     arg1 = (wxKeyCode) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg1 = (wxKeyCode) SWIG_AsInt(obj0); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxGetKeyState((wxKeyCode )arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxGetKeyState((wxKeyCode )arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -4305,11 +4340,12 @@ static PyObject *_wrap_WakeUpMainThread(PyObject *self, PyObject *args, PyObject
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":WakeUpMainThread",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":WakeUpMainThread",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxWakeUpMainThread();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxWakeUpMainThread();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -4326,11 +4362,12 @@ static PyObject *_wrap_MutexGuiEnter(PyObject *self, PyObject *args, PyObject *k
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":MutexGuiEnter",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":MutexGuiEnter",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxMutexGuiEnter();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxMutexGuiEnter();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -4347,11 +4384,12 @@ static PyObject *_wrap_MutexGuiLeave(PyObject *self, PyObject *args, PyObject *k
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":MutexGuiLeave",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":MutexGuiLeave",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxMutexGuiLeave();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxMutexGuiLeave();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -4369,11 +4407,12 @@ static PyObject *_wrap_new_MutexGuiLocker(PyObject *self, PyObject *args, PyObje
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_MutexGuiLocker",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_MutexGuiLocker",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxMutexGuiLocker *)new wxMutexGuiLocker();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxMutexGuiLocker *)new wxMutexGuiLocker();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMutexGuiLocker, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMutexGuiLocker, 1);
     return resultobj;
@@ -4455,11 +4494,12 @@ static PyObject *_wrap_new_ToolTip(PyObject *self, PyObject *args, PyObject *kwa
         temp1 = True;
     }
     {
         temp1 = True;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxToolTip *)new wxToolTip((wxString const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxToolTip *)new wxToolTip((wxString const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = wxPyMake_wxObject(result); 
     }
     {
         resultobj = wxPyMake_wxObject(result); 
@@ -4656,11 +4696,12 @@ static PyObject *_wrap_new_Caret(PyObject *self, PyObject *args, PyObject *kwarg
         if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail;
     }
     {
         if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxCaret *)new wxCaret(arg1,(wxSize const &)*arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxCaret *)new wxCaret(arg1,(wxSize const &)*arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxCaret, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxCaret, 1);
     return resultobj;
@@ -5171,11 +5212,12 @@ static PyObject *_wrap_new_BusyCursor(PyObject *self, PyObject *args, PyObject *
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxBusyCursor *)new wxBusyCursor(arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxBusyCursor *)new wxBusyCursor(arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBusyCursor, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBusyCursor, 1);
     return resultobj;
@@ -5231,11 +5273,12 @@ static PyObject *_wrap_new_WindowDisabler(PyObject *self, PyObject *args, PyObje
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindowDisabler *)new wxWindowDisabler(arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxWindowDisabler *)new wxWindowDisabler(arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWindowDisabler, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWindowDisabler, 1);
     return resultobj;
@@ -5293,11 +5336,12 @@ static PyObject *_wrap_new_BusyInfo(PyObject *self, PyObject *args, PyObject *kw
         temp1 = True;
     }
     {
         temp1 = True;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxBusyInfo *)new wxBusyInfo((wxString const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxBusyInfo *)new wxBusyInfo((wxString const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBusyInfo, 1);
     {
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBusyInfo, 1);
     {
@@ -6345,11 +6389,12 @@ static PyObject *_wrap_ShowTip(PyObject *self, PyObject *args, PyObject *kwargs)
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxShowTip(arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxShowTip(arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -6381,11 +6426,12 @@ static PyObject *_wrap_CreateFileTipProvider(PyObject *self, PyObject *args, PyO
     arg2 = (size_t) SWIG_AsUnsignedLong(obj1); 
     if (PyErr_Occurred()) SWIG_fail;
     {
     arg2 = (size_t) SWIG_AsUnsignedLong(obj1); 
     if (PyErr_Occurred()) SWIG_fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxTipProvider *)wxCreateFileTipProvider((wxString const &)*arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxTipProvider *)wxCreateFileTipProvider((wxString const &)*arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxTipProvider, 1);
     {
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxTipProvider, 1);
     {
@@ -6423,11 +6469,12 @@ static PyObject *_wrap_new_Timer(PyObject *self, PyObject *args, PyObject *kwarg
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxPyTimer *)new wxPyTimer(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxPyTimer *)new wxPyTimer(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyTimer, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyTimer, 1);
     return resultobj;
@@ -6823,11 +6870,12 @@ static PyObject *_wrap_new_TimerRunner__SWIG_0(PyObject *self, PyObject *args) {
         SWIG_fail;
     }
     {
         SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxTimerRunner *)new wxTimerRunner(*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxTimerRunner *)new wxTimerRunner(*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxTimerRunner, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxTimerRunner, 1);
     return resultobj;
@@ -6861,11 +6909,12 @@ static PyObject *_wrap_new_TimerRunner__SWIG_1(PyObject *self, PyObject *args) {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxTimerRunner *)new wxTimerRunner(*arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxTimerRunner *)new wxTimerRunner(*arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxTimerRunner, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxTimerRunner, 1);
     return resultobj;
@@ -9575,11 +9624,12 @@ static PyObject *_wrap_Execute(PyObject *self, PyObject *args, PyObject *kwargs)
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
         SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (long)wxExecute((wxString const &)*arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (long)wxExecute((wxString const &)*arg1,arg2,arg3);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_FromLong((long)result);
     {
     }
     resultobj = SWIG_FromLong((long)result);
     {
@@ -9611,11 +9661,12 @@ static PyObject *_wrap_new_Joystick(PyObject *self, PyObject *args, PyObject *kw
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxJoystick *)new wxJoystick(arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxJoystick *)new wxJoystick(arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxJoystick, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxJoystick, 1);
     return resultobj;
@@ -11557,11 +11608,12 @@ static PyObject *_wrap_new_Sound(PyObject *self, PyObject *args, PyObject *kwarg
         }
     }
     {
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxSound *)new_wxSound((wxString const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxSound *)new_wxSound((wxString const &)*arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxSound, 1);
     {
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxSound, 1);
     {
@@ -11590,11 +11642,12 @@ static PyObject *_wrap_new_SoundFromData(PyObject *self, PyObject *args, PyObjec
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_SoundFromData",kwnames,&obj0)) goto fail;
     arg1 = obj0;
     {
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_SoundFromData",kwnames,&obj0)) goto fail;
     arg1 = obj0;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxSound *)new_wxSound(arg1);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxSound *)new_wxSound(arg1);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxSound, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxSound, 1);
     return resultobj;
@@ -11750,11 +11803,12 @@ static PyObject *_wrap_Sound_Play(PyObject *self, PyObject *args, PyObject *kwar
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)((wxSound const *)arg1)->Play(arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)((wxSound const *)arg1)->Play(arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -11788,11 +11842,12 @@ static PyObject *_wrap_Sound_PlaySound(PyObject *self, PyObject *args, PyObject
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxSound::Play((wxString const &)*arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (bool)wxSound::Play((wxString const &)*arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
     }
     {
         resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
@@ -11819,11 +11874,12 @@ static PyObject *_wrap_Sound_Stop(PyObject *self, PyObject *args, PyObject *kwar
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":Sound_Stop",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":Sound_Stop",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxSound::Stop();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         wxSound::Stop();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
     }
     Py_INCREF(Py_None); resultobj = Py_None;
     return resultobj;
@@ -14316,11 +14372,12 @@ static PyObject *_wrap_new_ArtProvider(PyObject *self, PyObject *args, PyObject
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_ArtProvider",kwnames)) goto fail;
     {
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_ArtProvider",kwnames)) goto fail;
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxPyArtProvider *)new wxPyArtProvider();
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxPyArtProvider *)new wxPyArtProvider();
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyArtProvider, 1);
     return resultobj;
     }
     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyArtProvider, 1);
     return resultobj;
@@ -14475,11 +14532,12 @@ static PyObject *_wrap_ArtProvider_GetBitmap(PyObject *self, PyObject *args, PyO
         }
     }
     {
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxPyArtProvider::GetBitmap((wxString const &)*arg1,(wxString const &)*arg2,(wxSize const &)*arg3);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxPyArtProvider::GetBitmap((wxString const &)*arg1,(wxString const &)*arg2,(wxSize const &)*arg3);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxBitmap * resultptr;
     }
     {
         wxBitmap * resultptr;
@@ -14546,11 +14604,12 @@ static PyObject *_wrap_ArtProvider_GetIcon(PyObject *self, PyObject *args, PyObj
         }
     }
     {
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxPyArtProvider::GetIcon((wxString const &)*arg1,(wxString const &)*arg2,(wxSize const &)*arg3);
         
         wxPyEndAllowThreads(__tstate);
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = wxPyArtProvider::GetIcon((wxString const &)*arg1,(wxString const &)*arg2,(wxSize const &)*arg3);
         
         wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
+        if (PyErr_Occurred()) SWIG_fail;    
     }
     {
         wxIcon * resultptr;
     }
     {
         wxIcon * resultptr;