]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_dnd.i
reSWIGged
[wxWidgets.git] / wxPython / src / _dnd.i
index c1092402126571cba91f2b3bde5dd218a8bc134e..9c2ade6aa3a32bad05781600b886298eef1bf6de 100644 (file)
@@ -57,6 +57,7 @@ IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback);
 
 %name(DropSource) class wxPyDropSource {
 public:
+    %pythonAppend wxPyDropSource "self._setCallbackInfo(self, DropSource, 0)"
 #ifndef __WXGTK__
      wxPyDropSource(wxWindow *win,
                     const wxCursor &copy = wxNullCursor,
@@ -70,14 +71,13 @@ public:
 #endif
 
     void _setCallbackInfo(PyObject* self, PyObject* _class, int incref);
-    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxDropSource, 0)"
     ~wxPyDropSource();
 
     // set the data which is transfered by drag and drop
     void SetData(wxDataObject& data);
-    
+
     wxDataObject *GetDataObject();
-    
+
     // set the icon corresponding to given drag result
     void SetCursor(wxDragResult res, const wxCursor& cursor);
 
@@ -217,13 +217,13 @@ public:
 bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
                                      const wxArrayString& filenames) {
     bool rval = False;
-    wxPyBeginBlockThreads();
+    bool blocked = wxPyBeginBlockThreads();
     if (wxPyCBH_findCallback(m_myInst, "OnDropFiles")) {
         PyObject* list = wxArrayString2PyList_helper(filenames);
         rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",x,y,list));
         Py_DECREF(list);
     }
-    wxPyEndBlockThreads();
+    wxPyEndBlockThreads(blocked);
     return rval;
 }