]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/controls2.cpp
SWIGged changes for wxMac
[wxWidgets.git] / wxPython / src / msw / controls2.cpp
index b4f94ed28e20ac8bd93891f501d4ddb37f9ac77d..00389f7b288c8d299358f37b18d47b332e98e7a2 100644 (file)
@@ -100,6 +100,8 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     DECLARE_DEF_STRING(DirDialogDefaultFolderStr);
 
     static const wxString wxPyEmptyString(wxT(""));
+
+    static const long longzero = 0;
   // C++ Version of a Python aware class
 class wxPyListCtrl : public wxListCtrl {
     DECLARE_ABSTRACT_CLASS(wxPyListCtrl);
@@ -211,11 +213,13 @@ public:
         int rval = 0;
         bool found;
         wxPyBeginBlockThreads();
-        if ((found = m_myInst.findCallback("OnCompareItems")))
-            rval = m_myInst.callCallback(Py_BuildValue(
-                "(OO)",
-                wxPyConstructObject((void*)&item1, "wxTreeItemId"),
-                wxPyConstructObject((void*)&item2, "wxTreeItemId")));
+        if ((found = m_myInst.findCallback("OnCompareItems"))) {
+            PyObject *o1 = wxPyConstructObject((void*)&item1, "wxTreeItemId");
+            PyObject *o2 = wxPyConstructObject((void*)&item2, "wxTreeItemId");
+            rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2));
+            Py_DECREF(o1);
+            Py_DECREF(o2);
+        }
         wxPyEndBlockThreads();
         if (! found)
             rval = wxTreeCtrl::OnCompareItems(item1, item2);
@@ -3008,6 +3012,7 @@ static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject *
 
 static wxListItem * wxPyListCtrl_GetColumn(wxPyListCtrl *self,int  col) {
             wxListItem item;
+            item.SetMask(0xFFFF);
             if (self->GetColumn(col, item))
                 return new wxListItem(item);
             else
@@ -7780,7 +7785,7 @@ static PyObject *_wrap_wxTreeCtrl_GetFirstChild(PyObject *self, PyObject *args,
     wxTreeItemId * _result;
     wxPyTreeCtrl * _arg0;
     wxTreeItemId * _arg1;
-    long * _arg2 = (long *) &0;
+    long * _arg2 = (long *) &longzero;
     PyObject * _argo0 = 0;
     PyObject * _argo1 = 0;
     long  temp;