]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/gdi.cpp
Removed deprecation warnings in OGL and Gizmos
[wxWidgets.git] / wxPython / src / mac / gdi.cpp
index 4f9c6a0bd959a7c6e0a404bff3d8c4ab72c1cd39..171413ef9de0c67ba69c744cfd746b34dc140c47 100644 (file)
@@ -7583,6 +7583,8 @@ static PyObject *_wrap_wxDC_GetBoundingBox(PyObject *self, PyObject *args, PyObj
 }
 
 static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject * pyPens) {
+            wxPyBeginBlockThreads();
+
             bool      isFastSeq  = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
             bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
             int       numObjs = 0;
@@ -7591,6 +7593,7 @@ static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject *
             PyObject* obj;
             int       x1, y1;
             int       i = 0;
+            PyObject* retval;
 
             if (!PySequence_Check(pyPoints)) {
                 goto err0;
@@ -7633,6 +7636,13 @@ static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject *
                         Py_DECREF(obj);
                     goto err0;
                 }
+                if (PyErr_Occurred()) {
+                    retval = NULL;
+                    if (!isFastPens)
+                        Py_DECREF(obj);
+                    goto exit;
+                }
+
 
                 // Now draw the point
                 self->DrawPoint(x1, y1);
@@ -7642,14 +7652,21 @@ static PyObject * wxDC__DrawPointList(wxDC *self,PyObject * pyPoints,PyObject *
             }
 
             Py_INCREF(Py_None);
-            return Py_None;
+            retval = Py_None;
+            goto exit;
 
         err1:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
-            return NULL;
+            retval = NULL;
+            goto exit;
         err0:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
-            return NULL;
+            retval = NULL;
+            goto exit;
+
+        exit:
+            wxPyEndBlockThreads();
+            return retval;
         }
 static PyObject *_wrap_wxDC__DrawPointList(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
@@ -7691,6 +7708,8 @@ static PyObject *_wrap_wxDC__DrawPointList(PyObject *self, PyObject *args, PyObj
 }
 
 static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * pyPens) {
+            wxPyBeginBlockThreads();
+
             bool      isFastSeq  = PyList_Check(pyLines) || PyTuple_Check(pyLines);
             bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
             int       numObjs = 0;
@@ -7699,6 +7718,7 @@ static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * py
             PyObject* obj;
             int       x1, y1, x2, y2;
             int       i = 0;
+            PyObject* retval;
 
             if (!PySequence_Check(pyLines)) {
                 goto err0;
@@ -7741,6 +7761,12 @@ static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * py
                         Py_DECREF(obj);
                     goto err0;
                 }
+                if (PyErr_Occurred()) {
+                    retval = NULL;
+                    if (!isFastPens)
+                        Py_DECREF(obj);
+                    goto exit;
+                }
 
                 // Now draw the line
                 self->DrawLine(x1, y1, x2, y2);
@@ -7750,14 +7776,22 @@ static PyObject * wxDC__DrawLineList(wxDC *self,PyObject * pyLines,PyObject * py
             }
 
             Py_INCREF(Py_None);
-            return Py_None;
+            retval = Py_None;
+            goto exit;
 
         err1:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
-            return NULL;
+            retval = NULL;
+            goto exit;
+
         err0:
             PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x2,y2) sequences.");
-            return NULL;
+            retval = NULL;
+            goto exit;
+
+        exit:
+            wxPyEndBlockThreads();
+            return retval;
         }
 static PyObject *_wrap_wxDC__DrawLineList(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;