]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_pen.i
Use the wx.ART_NORMAL_FILE icon
[wxWidgets.git] / wxPython / src / _pen.i
index fc37c53409cff8934b81c808b5d57553445a67d0..e0fca1cb17ca0907d1ff6b6cc25cb7cd3ac1a8d1 100644 (file)
@@ -29,6 +29,8 @@
 %newgroup
 
 
 %newgroup
 
 
+MustHaveApp(wxPen);
+
 class wxPen : public wxGDIObject {
 public:
     wxPen(wxColour& colour, int width=1, int style=wxSOLID);
 class wxPen : public wxGDIObject {
 public:
     wxPen(wxColour& colour, int width=1, int style=wxSOLID);
@@ -54,16 +56,19 @@ public:
         PyObject* GetDashes() {
             wxDash* dashes;
             int count = self->GetDashes(&dashes);
         PyObject* GetDashes() {
             wxDash* dashes;
             int count = self->GetDashes(&dashes);
-            bool blocked = wxPyBeginBlockThreads();
+            wxPyBlock_t blocked = wxPyBeginBlockThreads();
             PyObject* retval = PyList_New(0);
             PyObject* retval = PyList_New(0);
-            for (int x=0; x<count; x++)
-                PyList_Append(retval, PyInt_FromLong(dashes[x]));
+            for (int x=0; x<count; x++) {
+                PyObject* pyint = PyInt_FromLong(dashes[x]);
+                PyList_Append(retval, pyint);
+                Py_DECREF(pyint);
+            }
             wxPyEndBlockThreads(blocked);
             return retval;
         }
 
         void _SetDashes(PyObject* _self, PyObject* pyDashes) {
             wxPyEndBlockThreads(blocked);
             return retval;
         }
 
         void _SetDashes(PyObject* _self, PyObject* pyDashes) {
-            bool blocked = wxPyBeginBlockThreads();
+            wxPyBlock_t blocked = wxPyBeginBlockThreads();
             int size = PyList_Size(pyDashes);
             wxDash* dashes = (wxDash*)byte_LIST_helper(pyDashes);
 
             int size = PyList_Size(pyDashes);
             wxDash* dashes = (wxDash*)byte_LIST_helper(pyDashes);
 
@@ -102,8 +107,8 @@ public:
 
     
     %extend {
 
     
     %extend {
-        bool __eq__(const wxPen* other) { return other ? (*self == *other) : False; }
-        bool __ne__(const wxPen* other) { return other ? (*self != *other) : True;  }
+        bool __eq__(const wxPen* other) { return other ? (*self == *other) : false; }
+        bool __ne__(const wxPen* other) { return other ? (*self != *other) : true;  }
     }
     %pythoncode { def __nonzero__(self): return self.Ok() }
 };
     }
     %pythoncode { def __nonzero__(self): return self.Ok() }
 };