]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/gtk/gdi.cpp
Added always-unsplittable style option (wxSP_PERMIT_UNSPLIT)
[wxWidgets.git] / utils / wxPython / src / gtk / gdi.cpp
index a677cdb08046e73e363a917a42c85e82ee7313f1..ff1443a7238d35d34b61fd1ee4021aae869f5c91 100644 (file)
@@ -124,9 +124,10 @@ static char* wxStringErrorMsg = "string type is required for parameter";
         return new wxBitmap(width, height, depth);
     }
 
-                                // This one won't own the reference, so Python won't call
-                                // the dtor, this is good for toolbars and such where
-                                // the parent will manage the bitmap.
+                                // This one won't own the reference, so Python
+                                // won't call the dtor, this is good for
+                                // toolbars and such where the parent will
+                                // manage the bitmap.
     wxBitmap* wxNoRefBitmap(char* name, long flags) {
         return new wxBitmap(name, flags);
     }
@@ -203,8 +204,12 @@ static PyObject *_wrap_wxEmptyBitmap(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,"ii|i:wxEmptyBitmap",&_arg0,&_arg1,&_arg2)) 
         return NULL;
-    _result = (wxBitmap *)wxEmptyBitmap(_arg0,_arg1,_arg2);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxBitmap *)wxEmptyBitmap(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -219,8 +224,12 @@ static PyObject *_wrap_wxNoRefBitmap(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,"sl:wxNoRefBitmap",&_arg0,&_arg1)) 
         return NULL;
-    _result = (wxBitmap *)wxNoRefBitmap(_arg0,_arg1);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxBitmap *)wxNoRefBitmap(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -249,8 +258,12 @@ static PyObject *_wrap_wxMaskColour(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxMask *)wxMaskColour(*_arg0,*_arg1);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxMask *)wxMaskColour(*_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -264,8 +277,12 @@ static PyObject *_wrap_wxStockCursor(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,"i:wxStockCursor",&_arg0)) 
         return NULL;
-    _result = (wxCursor *)wxPyStockCursor(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxCursor_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxCursor *)wxPyStockCursor(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxCursor_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -285,10 +302,14 @@ static PyObject *_wrap_wxNamedColour(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg0 = new wxString(PyString_AsString(_obj0));
+    _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0));
 }
-    _result = (wxColour *)wxNamedColour(*_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxColour *)wxNamedColour(*_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
 {
     if (_obj0)
@@ -313,8 +334,12 @@ static PyObject *_wrap_wxMemoryDCFromDC(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxMemoryDC *)wxMemoryDCFromDC(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMemoryDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxMemoryDC *)wxMemoryDCFromDC(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMemoryDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -966,10 +991,14 @@ static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg0 = new wxString(PyString_AsString(_obj0));
+    _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0));
 }
-    _result = (wxBitmap *)new_wxBitmap(*_arg0,_arg1);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxBitmap *)new_wxBitmap(*_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
     _resultobj = Py_BuildValue("s",_ptemp);
 {
     if (_obj0)
@@ -993,8 +1022,12 @@ static PyObject *_wrap_delete_wxBitmap(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxBitmap(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxBitmap(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1015,8 +1048,12 @@ static PyObject *_wrap_wxBitmap_GetDepth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxBitmap_GetDepth(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxBitmap_GetDepth(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1036,8 +1073,12 @@ static PyObject *_wrap_wxBitmap_GetHeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxBitmap_GetHeight(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxBitmap_GetHeight(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1058,8 +1099,12 @@ static PyObject *_wrap_wxBitmap_GetPalette(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxPalette *)wxBitmap_GetPalette(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPalette *)wxBitmap_GetPalette(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -1081,8 +1126,12 @@ static PyObject *_wrap_wxBitmap_GetMask(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxMask *)wxBitmap_GetMask(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxMask *)wxBitmap_GetMask(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -1103,8 +1152,12 @@ static PyObject *_wrap_wxBitmap_GetWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxBitmap_GetWidth(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxBitmap_GetWidth(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1132,10 +1185,14 @@ static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
-    _result = (bool )wxBitmap_LoadFile(_arg0,*_arg1,_arg2);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxBitmap_LoadFile(_arg0,*_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
 {
     if (_obj1)
         delete _arg1;
@@ -1159,8 +1216,12 @@ static PyObject *_wrap_wxBitmap_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxBitmap_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxBitmap_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1190,7 +1251,7 @@ static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
     if (_argc3) {
         if (SWIG_GetPtr(_argc3,(void **) &_arg3,"_wxPalette_p")) {
@@ -1198,8 +1259,12 @@ static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxBitmap_SaveFile(_arg0,*_arg1,_arg2,_arg3);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxBitmap_SaveFile(_arg0,*_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
 {
     if (_obj1)
         delete _arg1;
@@ -1223,8 +1288,12 @@ static PyObject *_wrap_wxBitmap_SetDepth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBitmap_SetDepth(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBitmap_SetDepth(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1245,8 +1314,12 @@ static PyObject *_wrap_wxBitmap_SetHeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBitmap_SetHeight(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBitmap_SetHeight(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1274,8 +1347,12 @@ static PyObject *_wrap_wxBitmap_SetMask(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBitmap_SetMask(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBitmap_SetMask(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1296,8 +1373,12 @@ static PyObject *_wrap_wxBitmap_SetWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBitmap_SetWidth(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBitmap_SetWidth(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1319,8 +1400,12 @@ static PyObject *_wrap_new_wxMask(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxMask *)new_wxMask(*_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxMask *)new_wxMask(*_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -1340,8 +1425,12 @@ static PyObject *_wrap_delete_wxMask(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxMask(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxMask(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1369,8 +1458,12 @@ static PyObject *_wrap_delete_wxIcon(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxIcon(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxIcon(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1391,8 +1484,12 @@ static PyObject *_wrap_wxIcon_GetDepth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxIcon_GetDepth(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxIcon_GetDepth(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1412,8 +1509,12 @@ static PyObject *_wrap_wxIcon_GetHeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxIcon_GetHeight(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxIcon_GetHeight(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1433,8 +1534,12 @@ static PyObject *_wrap_wxIcon_GetWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxIcon_GetWidth(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxIcon_GetWidth(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1462,10 +1567,14 @@ static PyObject *_wrap_wxIcon_LoadFile(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
-    _result = (bool )wxIcon_LoadFile(_arg0,*_arg1,_arg2);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxIcon_LoadFile(_arg0,*_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
 {
     if (_obj1)
         delete _arg1;
@@ -1489,8 +1598,12 @@ static PyObject *_wrap_wxIcon_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxIcon_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxIcon_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1510,8 +1623,12 @@ static PyObject *_wrap_wxIcon_SetDepth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxIcon_SetDepth(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxIcon_SetDepth(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1532,8 +1649,12 @@ static PyObject *_wrap_wxIcon_SetHeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxIcon_SetHeight(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxIcon_SetHeight(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1554,8 +1675,12 @@ static PyObject *_wrap_wxIcon_SetWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxIcon_SetWidth(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxIcon_SetWidth(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1583,8 +1708,12 @@ static PyObject *_wrap_delete_wxCursor(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxCursor(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxCursor(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1605,8 +1734,12 @@ static PyObject *_wrap_wxCursor_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxCursor_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxCursor_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1630,8 +1763,12 @@ static PyObject *_wrap_new_wxFont(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,"iiii|is:new_wxFont",&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5)) 
         return NULL;
-    _result = (wxFont *)new_wxFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxFont *)new_wxFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -1652,8 +1789,12 @@ static PyObject *_wrap_wxFont_GetFaceName(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = new wxString (wxFont_GetFaceName(_arg0));
 {
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = new wxString (wxFont_GetFaceName(_arg0));
+
+    wxPy_END_ALLOW_THREADS;
+}{
     _resultobj = PyString_FromString(WXSTRINGCAST *(_result));
 }
 {
@@ -1678,8 +1819,12 @@ static PyObject *_wrap_wxFont_GetFamily(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxFont_GetFamily(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxFont_GetFamily(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1699,8 +1844,12 @@ static PyObject *_wrap_wxFont_GetPointSize(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxFont_GetPointSize(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxFont_GetPointSize(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1720,8 +1869,12 @@ static PyObject *_wrap_wxFont_GetStyle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxFont_GetStyle(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxFont_GetStyle(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1741,8 +1894,12 @@ static PyObject *_wrap_wxFont_GetUnderlined(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxFont_GetUnderlined(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxFont_GetUnderlined(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1762,8 +1919,12 @@ static PyObject *_wrap_wxFont_GetWeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxFont_GetWeight(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxFont_GetWeight(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -1789,10 +1950,14 @@ static PyObject *_wrap_wxFont_SetFaceName(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
-    wxFont_SetFaceName(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont_SetFaceName(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     if (_obj1)
@@ -1817,8 +1982,12 @@ static PyObject *_wrap_wxFont_SetFamily(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxFont_SetFamily(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont_SetFamily(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1839,8 +2008,12 @@ static PyObject *_wrap_wxFont_SetPointSize(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxFont_SetPointSize(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont_SetPointSize(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1861,8 +2034,12 @@ static PyObject *_wrap_wxFont_SetStyle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxFont_SetStyle(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont_SetStyle(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1885,8 +2062,12 @@ static PyObject *_wrap_wxFont_SetUnderlined(PyObject *self, PyObject *args) {
         }
     }
     _arg1 = (bool ) tempbool1;
-    wxFont_SetUnderlined(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont_SetUnderlined(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1907,8 +2088,12 @@ static PyObject *_wrap_wxFont_SetWeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxFont_SetWeight(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont_SetWeight(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1925,8 +2110,12 @@ static PyObject *_wrap_new_wxColour(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,"|bbb:new_wxColour",&_arg0,&_arg1,&_arg2)) 
         return NULL;
-    _result = (wxColour *)new_wxColour(_arg0,_arg1,_arg2);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxColour *)new_wxColour(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -1946,8 +2135,12 @@ static PyObject *_wrap_delete_wxColour(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxColour(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxColour(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -1968,8 +2161,12 @@ static PyObject *_wrap_wxColour_Red(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (unsigned char )wxColour_Red(_arg0);
-    _resultobj = Py_BuildValue("b",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (unsigned char )wxColour_Red(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("b",_result);
     return _resultobj;
 }
 
@@ -1989,8 +2186,12 @@ static PyObject *_wrap_wxColour_Green(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (unsigned char )wxColour_Green(_arg0);
-    _resultobj = Py_BuildValue("b",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (unsigned char )wxColour_Green(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("b",_result);
     return _resultobj;
 }
 
@@ -2010,8 +2211,12 @@ static PyObject *_wrap_wxColour_Blue(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (unsigned char )wxColour_Blue(_arg0);
-    _resultobj = Py_BuildValue("b",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (unsigned char )wxColour_Blue(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("b",_result);
     return _resultobj;
 }
 
@@ -2031,8 +2236,12 @@ static PyObject *_wrap_wxColour_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxColour_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxColour_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2054,8 +2263,12 @@ static PyObject *_wrap_wxColour_Set(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxColour_Set(_arg0,_arg1,_arg2,_arg3);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxColour_Set(_arg0,_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2082,8 +2295,12 @@ static PyObject *_wrap_wxColour_Get(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (PyObject *)wxColour_Get(_arg0);
 {
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (PyObject *)wxColour_Get(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}{
   _resultobj = _result;
 }
     return _resultobj;
@@ -2111,8 +2328,12 @@ static PyObject *_wrap_new_wxPen(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxPen *)new_wxPen(_arg0,_arg1,_arg2);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPen_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPen *)new_wxPen(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPen_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -2133,8 +2354,12 @@ static PyObject *_wrap_wxPen_GetCap(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxPen_GetCap(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxPen_GetCap(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2155,9 +2380,13 @@ static PyObject *_wrap_wxPen_GetColour(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxColour & _result_ref = wxPen_GetColour(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxColour & _result_ref = wxPen_GetColour(_arg0);
     _result = (wxColour *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -2178,8 +2407,12 @@ static PyObject *_wrap_wxPen_GetJoin(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxPen_GetJoin(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxPen_GetJoin(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2199,8 +2432,12 @@ static PyObject *_wrap_wxPen_GetStyle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxPen_GetStyle(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxPen_GetStyle(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2220,8 +2457,12 @@ static PyObject *_wrap_wxPen_GetWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxPen_GetWidth(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxPen_GetWidth(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2241,8 +2482,12 @@ static PyObject *_wrap_wxPen_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxPen_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxPen_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2262,8 +2507,12 @@ static PyObject *_wrap_wxPen_SetCap(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxPen_SetCap(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen_SetCap(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2291,8 +2540,12 @@ static PyObject *_wrap_wxPen_SetColour(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxPen_SetColour(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen_SetColour(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2313,8 +2566,12 @@ static PyObject *_wrap_wxPen_SetJoin(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxPen_SetJoin(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen_SetJoin(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2335,8 +2592,12 @@ static PyObject *_wrap_wxPen_SetStyle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxPen_SetStyle(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen_SetStyle(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2357,8 +2618,12 @@ static PyObject *_wrap_wxPen_SetWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxPen_SetWidth(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen_SetWidth(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2384,8 +2649,12 @@ static PyObject *_wrap_new_wxBrush(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxBrush *)new_wxBrush(_arg0,_arg1);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxBrush *)new_wxBrush(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -2407,9 +2676,13 @@ static PyObject *_wrap_wxBrush_GetColour(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxColour & _result_ref = wxBrush_GetColour(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxColour & _result_ref = wxBrush_GetColour(_arg0);
     _result = (wxColour *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -2431,8 +2704,12 @@ static PyObject *_wrap_wxBrush_GetStipple(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxBitmap *)wxBrush_GetStipple(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxBitmap *)wxBrush_GetStipple(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -2453,8 +2730,12 @@ static PyObject *_wrap_wxBrush_GetStyle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxBrush_GetStyle(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxBrush_GetStyle(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2474,8 +2755,12 @@ static PyObject *_wrap_wxBrush_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxBrush_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxBrush_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2502,8 +2787,12 @@ static PyObject *_wrap_wxBrush_SetColour(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBrush_SetColour(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBrush_SetColour(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2531,8 +2820,12 @@ static PyObject *_wrap_wxBrush_SetStipple(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBrush_SetStipple(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBrush_SetStipple(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2553,8 +2846,12 @@ static PyObject *_wrap_wxBrush_SetStyle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBrush_SetStyle(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBrush_SetStyle(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2574,8 +2871,12 @@ static PyObject *_wrap_delete_wxDC(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxDC(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxDC(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2595,8 +2896,12 @@ static PyObject *_wrap_wxDC_BeginDrawing(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_BeginDrawing(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_BeginDrawing(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2632,8 +2937,12 @@ static PyObject *_wrap_wxDC_Blit(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxDC_Blit(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7,_arg8);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxDC_Blit(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7,_arg8);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -2652,8 +2961,12 @@ static PyObject *_wrap_wxDC_Clear(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_Clear(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_Clear(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2675,8 +2988,12 @@ static PyObject *_wrap_wxDC_CrossHair(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_CrossHair(_arg0,_arg1,_arg2);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_CrossHair(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2696,8 +3013,12 @@ static PyObject *_wrap_wxDC_DestroyClippingRegion(PyObject *self, PyObject *args
         return NULL;
         }
     }
-    wxDC_DestroyClippingRegion(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DestroyClippingRegion(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2719,8 +3040,12 @@ static PyObject *_wrap_wxDC_DeviceToLogicalX(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_DeviceToLogicalX(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_DeviceToLogicalX(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -2741,8 +3066,12 @@ static PyObject *_wrap_wxDC_DeviceToLogicalXRel(PyObject *self, PyObject *args)
         return NULL;
         }
     }
-    _result = (long )wxDC_DeviceToLogicalXRel(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_DeviceToLogicalXRel(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -2763,8 +3092,12 @@ static PyObject *_wrap_wxDC_DeviceToLogicalY(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_DeviceToLogicalY(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_DeviceToLogicalY(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -2785,8 +3118,12 @@ static PyObject *_wrap_wxDC_DeviceToLogicalYRel(PyObject *self, PyObject *args)
         return NULL;
         }
     }
-    _result = (long )wxDC_DeviceToLogicalYRel(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_DeviceToLogicalYRel(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -2811,8 +3148,12 @@ static PyObject *_wrap_wxDC_DrawArc(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawArc(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawArc(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2836,8 +3177,12 @@ static PyObject *_wrap_wxDC_DrawEllipse(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawEllipse(_arg0,_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawEllipse(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2863,8 +3208,12 @@ static PyObject *_wrap_wxDC_DrawEllipticArc(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawEllipticArc(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawEllipticArc(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2894,8 +3243,12 @@ static PyObject *_wrap_wxDC_DrawIcon(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawIcon(_arg0,*_arg1,_arg2,_arg3);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawIcon(_arg0,*_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2919,8 +3272,12 @@ static PyObject *_wrap_wxDC_DrawLine(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawLine(_arg0,_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawLine(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -2953,10 +3310,19 @@ static PyObject *_wrap_wxDC_DrawLines(PyObject *self, PyObject *args) {
     }
 }
 {
-    _arg1 = PyList_Size(_obj2);
+    if (_obj2) {
+        _arg1 = PyList_Size(_obj2);
+    }
+    else {
+        _arg1 = 0;
+    }
 }
-    wxDC_DrawLines(_arg0,_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawLines(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     delete [] _arg2;
@@ -2993,10 +3359,19 @@ static PyObject *_wrap_wxDC_DrawPolygon(PyObject *self, PyObject *args) {
     }
 }
 {
-    _arg1 = PyList_Size(_obj2);
+    if (_obj2) {
+        _arg1 = PyList_Size(_obj2);
+    }
+    else {
+        _arg1 = 0;
+    }
 }
-    wxDC_DrawPolygon(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawPolygon(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     delete [] _arg2;
@@ -3021,8 +3396,12 @@ static PyObject *_wrap_wxDC_DrawPoint(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawPoint(_arg0,_arg1,_arg2);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawPoint(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3046,8 +3425,12 @@ static PyObject *_wrap_wxDC_DrawRectangle(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_DrawRectangle(_arg0,_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawRectangle(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3072,8 +3455,12 @@ static PyObject *_wrap_wxDC_DrawRoundedRectangle(PyObject *self, PyObject *args)
         return NULL;
         }
     }
-    wxDC_DrawRoundedRectangle(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawRoundedRectangle(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3104,10 +3491,19 @@ static PyObject *_wrap_wxDC_DrawSpline(PyObject *self, PyObject *args) {
     }
 }
 {
-    _arg1 = PyList_Size(_obj2);
+    if (_obj2) {
+        _arg1 = PyList_Size(_obj2);
+    }
+    else {
+        _arg1 = 0;
+    }
 }
-    wxDC_DrawSpline(_arg0,_arg1,_arg2);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawSpline(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     delete [] _arg2;
@@ -3139,10 +3535,14 @@ static PyObject *_wrap_wxDC_DrawText(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
-    wxDC_DrawText(_arg0,*_arg1,_arg2,_arg3);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawText(_arg0,*_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     if (_obj1)
@@ -3166,8 +3566,12 @@ static PyObject *_wrap_wxDC_EndDoc(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_EndDoc(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_EndDoc(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3187,8 +3591,12 @@ static PyObject *_wrap_wxDC_EndDrawing(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_EndDrawing(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_EndDrawing(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3208,8 +3616,12 @@ static PyObject *_wrap_wxDC_EndPage(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_EndPage(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_EndPage(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3240,8 +3652,12 @@ static PyObject *_wrap_wxDC_FloodFill(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_FloodFill(_arg0,_arg1,_arg2,*_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_FloodFill(_arg0,_arg1,_arg2,*_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -3263,9 +3679,13 @@ static PyObject *_wrap_wxDC_GetBackground(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBrush & _result_ref = wxDC_GetBackground(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBrush & _result_ref = wxDC_GetBackground(_arg0);
     _result = (wxBrush *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3287,9 +3707,13 @@ static PyObject *_wrap_wxDC_GetBrush(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxBrush & _result_ref = wxDC_GetBrush(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxBrush & _result_ref = wxDC_GetBrush(_arg0);
     _result = (wxBrush *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxBrush_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3310,8 +3734,12 @@ static PyObject *_wrap_wxDC_GetCharHeight(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_GetCharHeight(_arg0);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_GetCharHeight(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3331,8 +3759,12 @@ static PyObject *_wrap_wxDC_GetCharWidth(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_GetCharWidth(_arg0);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_GetCharWidth(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3371,8 +3803,12 @@ static PyObject *_wrap_wxDC_GetClippingBox(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_GetClippingBox(_arg0,_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_GetClippingBox(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     PyObject *o;
@@ -3414,9 +3850,13 @@ static PyObject *_wrap_wxDC_GetFont(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxFont & _result_ref = wxDC_GetFont(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxFont & _result_ref = wxDC_GetFont(_arg0);
     _result = (wxFont *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3437,8 +3877,12 @@ static PyObject *_wrap_wxDC_GetLogicalFunction(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxDC_GetLogicalFunction(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxDC_GetLogicalFunction(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -3458,8 +3902,12 @@ static PyObject *_wrap_wxDC_GetMapMode(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxDC_GetMapMode(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxDC_GetMapMode(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -3479,8 +3927,12 @@ static PyObject *_wrap_wxDC_GetOptimization(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxDC_GetOptimization(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxDC_GetOptimization(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -3501,9 +3953,13 @@ static PyObject *_wrap_wxDC_GetPen(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxPen & _result_ref = wxDC_GetPen(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxPen & _result_ref = wxDC_GetPen(_arg0);
     _result = (wxPen *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPen_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPen_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3531,8 +3987,12 @@ static PyObject *_wrap_wxDC_GetPixel(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxColour *)wxDC_GetPixel(_arg0,_arg1,_arg2);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxColour *)wxDC_GetPixel(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3562,8 +4022,12 @@ static PyObject *_wrap_wxDC_GetSize(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_GetSize(_arg0,_arg1,_arg2);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_GetSize(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     PyObject *o;
@@ -3595,9 +4059,13 @@ static PyObject *_wrap_wxDC_GetTextBackground(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxColour & _result_ref = wxDC_GetTextBackground(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxColour & _result_ref = wxDC_GetTextBackground(_arg0);
     _result = (wxColour *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3634,10 +4102,14 @@ static PyObject *_wrap_wxDC_GetTextExtent(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
-    wxDC_GetTextExtent(_arg0,*_arg1,_arg2,_arg3);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_GetTextExtent(_arg0,*_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     PyObject *o;
@@ -3700,7 +4172,7 @@ static PyObject *_wrap_wxDC_GetFullTextExtent(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
     if (_argc6) {
         if (SWIG_GetPtr(_argc6,(void **) &_arg6,"_wxFont_p")) {
@@ -3708,8 +4180,12 @@ static PyObject *_wrap_wxDC_GetFullTextExtent(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_GetFullTextExtent(_arg0,*_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_GetFullTextExtent(_arg0,*_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
 {
     PyObject *o;
@@ -3755,9 +4231,13 @@ static PyObject *_wrap_wxDC_GetTextForeground(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxColour & _result_ref = wxDC_GetTextForeground(_arg0);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxColour & _result_ref = wxDC_GetTextForeground(_arg0);
     _result = (wxColour *) &_result_ref;
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxColour_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -3779,8 +4259,12 @@ static PyObject *_wrap_wxDC_LogicalToDeviceX(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_LogicalToDeviceX(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_LogicalToDeviceX(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3801,8 +4285,12 @@ static PyObject *_wrap_wxDC_LogicalToDeviceXRel(PyObject *self, PyObject *args)
         return NULL;
         }
     }
-    _result = (long )wxDC_LogicalToDeviceXRel(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_LogicalToDeviceXRel(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3823,8 +4311,12 @@ static PyObject *_wrap_wxDC_LogicalToDeviceY(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_LogicalToDeviceY(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_LogicalToDeviceY(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3845,8 +4337,12 @@ static PyObject *_wrap_wxDC_LogicalToDeviceYRel(PyObject *self, PyObject *args)
         return NULL;
         }
     }
-    _result = (long )wxDC_LogicalToDeviceYRel(_arg0,_arg1);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_LogicalToDeviceYRel(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3866,8 +4362,12 @@ static PyObject *_wrap_wxDC_MaxX(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_MaxX(_arg0);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_MaxX(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3887,8 +4387,12 @@ static PyObject *_wrap_wxDC_MaxY(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_MaxY(_arg0);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_MaxY(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3908,8 +4412,12 @@ static PyObject *_wrap_wxDC_MinX(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_MinX(_arg0);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_MinX(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3929,8 +4437,12 @@ static PyObject *_wrap_wxDC_MinY(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (long )wxDC_MinY(_arg0);
-    _resultobj = Py_BuildValue("l",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (long )wxDC_MinY(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("l",_result);
     return _resultobj;
 }
 
@@ -3950,8 +4462,12 @@ static PyObject *_wrap_wxDC_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxDC_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxDC_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -3972,8 +4488,12 @@ static PyObject *_wrap_wxDC_SetDeviceOrigin(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetDeviceOrigin(_arg0,_arg1,_arg2);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetDeviceOrigin(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4001,8 +4521,12 @@ static PyObject *_wrap_wxDC_SetBackground(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetBackground(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetBackground(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4023,8 +4547,12 @@ static PyObject *_wrap_wxDC_SetBackgroundMode(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetBackgroundMode(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetBackgroundMode(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4048,8 +4576,12 @@ static PyObject *_wrap_wxDC_SetClippingRegion(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetClippingRegion(_arg0,_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetClippingRegion(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4077,8 +4609,12 @@ static PyObject *_wrap_wxDC_SetPalette(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetPalette(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetPalette(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4106,8 +4642,12 @@ static PyObject *_wrap_wxDC_SetBrush(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetBrush(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetBrush(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4135,8 +4675,12 @@ static PyObject *_wrap_wxDC_SetFont(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetFont(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetFont(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4157,8 +4701,12 @@ static PyObject *_wrap_wxDC_SetLogicalFunction(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetLogicalFunction(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetLogicalFunction(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4179,8 +4727,12 @@ static PyObject *_wrap_wxDC_SetMapMode(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetMapMode(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetMapMode(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4203,8 +4755,12 @@ static PyObject *_wrap_wxDC_SetOptimization(PyObject *self, PyObject *args) {
         }
     }
     _arg1 = (bool ) tempbool1;
-    wxDC_SetOptimization(_arg0,_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetOptimization(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4232,8 +4788,12 @@ static PyObject *_wrap_wxDC_SetPen(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetPen(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetPen(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4261,8 +4821,12 @@ static PyObject *_wrap_wxDC_SetTextBackground(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetTextBackground(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetTextBackground(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4290,8 +4854,12 @@ static PyObject *_wrap_wxDC_SetTextForeground(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetTextForeground(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetTextForeground(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4313,8 +4881,12 @@ static PyObject *_wrap_wxDC_SetUserScale(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_SetUserScale(_arg0,_arg1,_arg2);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_SetUserScale(_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4342,10 +4914,14 @@ static PyObject *_wrap_wxDC_StartDoc(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg1 = new wxString(PyString_AsString(_obj1));
+    _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
 }
-    _result = (bool )wxDC_StartDoc(_arg0,*_arg1);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxDC_StartDoc(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
 {
     if (_obj1)
         delete _arg1;
@@ -4368,8 +4944,12 @@ static PyObject *_wrap_wxDC_StartPage(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxDC_StartPage(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_StartPage(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4411,8 +4991,12 @@ static PyObject *_wrap_wxDC_DrawBitmap(PyObject *self, PyObject *args) {
         }
     }
     _arg4 = (bool ) tempbool4;
-    wxDC_DrawBitmap(_arg0,*_arg1,_arg2,_arg3,_arg4);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDC_DrawBitmap(_arg0,*_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4434,8 +5018,12 @@ static PyObject *_wrap_new_wxMemoryDC(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,":new_wxMemoryDC")) 
         return NULL;
-    _result = (wxMemoryDC *)new_wxMemoryDC();
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMemoryDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxMemoryDC *)new_wxMemoryDC();
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxMemoryDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -4463,8 +5051,12 @@ static PyObject *_wrap_wxMemoryDC_SelectObject(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    wxMemoryDC_SelectObject(_arg0,*_arg1);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxMemoryDC_SelectObject(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4486,8 +5078,12 @@ static PyObject *_wrap_new_wxScreenDC(PyObject *self, PyObject *args) {
     self = self;
     if(!PyArg_ParseTuple(args,":new_wxScreenDC")) 
         return NULL;
-    _result = (wxScreenDC *)new_wxScreenDC();
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxScreenDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxScreenDC *)new_wxScreenDC();
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxScreenDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -4516,8 +5112,12 @@ static PyObject *_wrap_wxScreenDC_StartDrawingOnTop(PyObject *self, PyObject *ar
         return NULL;
         }
     }
-    _result = (bool )wxScreenDC_StartDrawingOnTop(_arg0,_arg1);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxScreenDC_StartDrawingOnTop(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4545,8 +5145,12 @@ static PyObject *_wrap_wxScreenDC_StartDrawingOnTopRect(PyObject *self, PyObject
         return NULL;
         }
     }
-    _result = (bool )wxScreenDC_StartDrawingOnTopRect(_arg0,_arg1);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxScreenDC_StartDrawingOnTopRect(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4566,8 +5170,12 @@ static PyObject *_wrap_wxScreenDC_EndDrawingOnTop(PyObject *self, PyObject *args
         return NULL;
         }
     }
-    _result = (bool )wxScreenDC_EndDrawingOnTop(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxScreenDC_EndDrawingOnTop(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4596,8 +5204,12 @@ static PyObject *_wrap_new_wxClientDC(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxClientDC *)new_wxClientDC(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxClientDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxClientDC *)new_wxClientDC(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxClientDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -4627,8 +5239,12 @@ static PyObject *_wrap_new_wxPaintDC(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxPaintDC *)new_wxPaintDC(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPaintDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPaintDC *)new_wxPaintDC(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPaintDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -4658,8 +5274,12 @@ static PyObject *_wrap_new_wxWindowDC(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxWindowDC *)new_wxWindowDC(_arg0);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxWindowDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxWindowDC *)new_wxWindowDC(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxWindowDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -4692,7 +5312,7 @@ static PyObject *_wrap_new_wxPostScriptDC(PyObject *self, PyObject *args) {
         PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
-    _arg0 = new wxString(PyString_AsString(_obj0));
+    _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0));
 }
     _arg1 = (bool ) tempbool1;
     if (_argc2) {
@@ -4701,8 +5321,12 @@ static PyObject *_wrap_new_wxPostScriptDC(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (wxPostScriptDC *)new_wxPostScriptDC(*_arg0,_arg1,_arg2);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPostScriptDC_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPostScriptDC *)new_wxPostScriptDC(*_arg0,_arg1,_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPostScriptDC_p");
     _resultobj = Py_BuildValue("s",_ptemp);
 {
     if (_obj0)
@@ -4747,10 +5371,19 @@ static PyObject *_wrap_new_wxPalette(PyObject *self, PyObject *args) {
     }
 }
 {
-    _arg0 = PyList_Size(_obj1);
+    if (_obj1) {
+        _arg0 = PyList_Size(_obj1);
+    }
+    else {
+        _arg0 = 0;
+    }
 }
-    _result = (wxPalette *)new_wxPalette(_arg0,_arg1,_arg2,_arg3);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxPalette *)new_wxPalette(_arg0,_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
     _resultobj = Py_BuildValue("s",_ptemp);
 {
     delete [] _arg1;
@@ -4779,8 +5412,12 @@ static PyObject *_wrap_delete_wxPalette(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxPalette(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxPalette(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4804,8 +5441,12 @@ static PyObject *_wrap_wxPalette_GetPixel(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxPalette_GetPixel(_arg0,_arg1,_arg2,_arg3);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxPalette_GetPixel(_arg0,_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4850,8 +5491,12 @@ static PyObject *_wrap_wxPalette_GetRGB(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxPalette_GetRGB(_arg0,_arg1,_arg2,_arg3,_arg4);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxPalette_GetRGB(_arg0,_arg1,_arg2,_arg3,_arg4);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4871,8 +5516,12 @@ static PyObject *_wrap_wxPalette_Ok(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxPalette_Ok(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxPalette_Ok(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4891,8 +5540,12 @@ static PyObject *_wrap_new_wxImageList(PyObject *self, PyObject *args) {
     if(!PyArg_ParseTuple(args,"ii|ii:new_wxImageList",&_arg0,&_arg1,&tempbool2,&_arg3)) 
         return NULL;
     _arg2 = (bool ) tempbool2;
-    _result = (wxImageList *)new_wxImageList(_arg0,_arg1,_arg2,_arg3);
-    SWIG_MakePtr(_ptemp, (char *) _result,"_wxImageList_p");
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (wxImageList *)new_wxImageList(_arg0,_arg1,_arg2,_arg3);
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (char *) _result,"_wxImageList_p");
     _resultobj = Py_BuildValue("s",_ptemp);
     return _resultobj;
 }
@@ -4912,8 +5565,12 @@ static PyObject *_wrap_delete_wxImageList(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    delete_wxImageList(_arg0);
-    Py_INCREF(Py_None);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        delete_wxImageList(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
     _resultobj = Py_None;
     return _resultobj;
 }
@@ -4942,8 +5599,12 @@ static PyObject *_wrap_wxImageList_Add(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (int )wxImageList_Add(_arg0,*_arg1);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxImageList_Add(_arg0,*_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -4972,8 +5633,12 @@ static PyObject *_wrap_wxImageList_Replace(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxImageList_Replace(_arg0,_arg1,*_arg2);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxImageList_Replace(_arg0,_arg1,*_arg2);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -5008,8 +5673,12 @@ static PyObject *_wrap_wxImageList_Draw(PyObject *self, PyObject *args) {
         }
     }
     _arg6 = (bool ) tempbool6;
-    _result = (bool )wxImageList_Draw(_arg0,_arg1,*_arg2,_arg3,_arg4,_arg5,_arg6);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxImageList_Draw(_arg0,_arg1,*_arg2,_arg3,_arg4,_arg5,_arg6);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -5029,8 +5698,12 @@ static PyObject *_wrap_wxImageList_GetImageCount(PyObject *self, PyObject *args)
         return NULL;
         }
     }
-    _result = (int )wxImageList_GetImageCount(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxImageList_GetImageCount(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -5051,8 +5724,12 @@ static PyObject *_wrap_wxImageList_Remove(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxImageList_Remove(_arg0,_arg1);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxImageList_Remove(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -5072,8 +5749,12 @@ static PyObject *_wrap_wxImageList_RemoveAll(PyObject *self, PyObject *args) {
         return NULL;
         }
     }
-    _result = (bool )wxImageList_RemoveAll(_arg0);
-    _resultobj = Py_BuildValue("i",_result);
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (bool )wxImageList_RemoveAll(_arg0);
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
 }
 
@@ -5335,12 +6016,17 @@ SWIGEXPORT(void,initgdic)() {
         SWIG_RegisterMapping("_wxDC","_class_wxMemoryDC",SwigwxMemoryDCTowxDC);
         SWIG_RegisterMapping("_wxDC","_wxMemoryDC",SwigwxMemoryDCTowxDC);
         SWIG_RegisterMapping("_wxDC","_class_wxDC",0);
+        SWIG_RegisterMapping("_size_t","_unsigned_int",0);
+        SWIG_RegisterMapping("_size_t","_int",0);
+        SWIG_RegisterMapping("_size_t","_wxWindowID",0);
+        SWIG_RegisterMapping("_size_t","_uint",0);
         SWIG_RegisterMapping("_class_wxRealPoint","_wxRealPoint",0);
         SWIG_RegisterMapping("_class_wxPostScriptDC","_wxPostScriptDC",0);
         SWIG_RegisterMapping("_class_wxToolTip","_wxToolTip",0);
         SWIG_RegisterMapping("_class_wxMask","_wxMask",0);
         SWIG_RegisterMapping("_wxColour","_class_wxColour",0);
         SWIG_RegisterMapping("_wxBrush","_class_wxBrush",0);
+        SWIG_RegisterMapping("_uint","_size_t",0);
         SWIG_RegisterMapping("_uint","_unsigned_int",0);
         SWIG_RegisterMapping("_uint","_int",0);
         SWIG_RegisterMapping("_uint","_wxWindowID",0);
@@ -5401,6 +6087,7 @@ SWIGEXPORT(void,initgdic)() {
         SWIG_RegisterMapping("_class_wxCursor","_wxCursor",0);
         SWIG_RegisterMapping("_wxPostScriptDC","_class_wxPostScriptDC",0);
         SWIG_RegisterMapping("_unsigned_char","_byte",0);
+        SWIG_RegisterMapping("_unsigned_int","_size_t",0);
         SWIG_RegisterMapping("_unsigned_int","_uint",0);
         SWIG_RegisterMapping("_unsigned_int","_wxWindowID",0);
         SWIG_RegisterMapping("_unsigned_int","_int",0);
@@ -5410,11 +6097,13 @@ SWIGEXPORT(void,initgdic)() {
         SWIG_RegisterMapping("_short","_unsigned_short",0);
         SWIG_RegisterMapping("_short","_signed_short",0);
         SWIG_RegisterMapping("_class_wxImageList","_wxImageList",0);
+        SWIG_RegisterMapping("_wxWindowID","_size_t",0);
         SWIG_RegisterMapping("_wxWindowID","_EBool",0);
         SWIG_RegisterMapping("_wxWindowID","_uint",0);
         SWIG_RegisterMapping("_wxWindowID","_int",0);
         SWIG_RegisterMapping("_wxWindowID","_signed_int",0);
         SWIG_RegisterMapping("_wxWindowID","_unsigned_int",0);
+        SWIG_RegisterMapping("_int","_size_t",0);
         SWIG_RegisterMapping("_int","_EBool",0);
         SWIG_RegisterMapping("_int","_uint",0);
         SWIG_RegisterMapping("_int","_wxWindowID",0);