X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6477984b100047f1d4f4f6049d51d4829712fea..3e3b7e75561ddcad61f12b914ecbc9ad06938789:/wxPython/src/_dnd.i?ds=sidebyside diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index 4e59285844..cf7c3c84b9 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -118,9 +118,9 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop); %name(DropTarget) class wxPyDropTarget // : public wxDropTarget { public: - %addtofunc wxPyDropTarget - "if args: args[0].thisown = 0; - self._setCallbackInfo(self, DropTarget)" + %pythonAppend wxPyDropTarget + "self._setCallbackInfo(self, DropTarget)" + %apply SWIGTYPE *DISOWN { wxDataObject *dataObject }; wxPyDropTarget(wxDataObject *dataObject = NULL); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -129,9 +129,10 @@ public: // get/set the associated wxDataObject wxDataObject *GetDataObject(); - %addtofunc SetDataObject "args[1].thisown = 0" void SetDataObject(wxDataObject *dataObject); + %clear wxDataObject *dataObject; + wxDragResult base_OnEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult base_OnDragOver(wxCoord x, wxCoord y, wxDragResult def); void base_OnLeave(); @@ -179,7 +180,7 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyTextDropTarget, wxTextDropTarget, OnDrop); %name(TextDropTarget) class wxPyTextDropTarget : public wxPyDropTarget { public: - %addtofunc wxPyTextDropTarget "self._setCallbackInfo(self, TextDropTarget)" + %pythonAppend wxPyTextDropTarget "self._setCallbackInfo(self, TextDropTarget)" wxPyTextDropTarget(); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -216,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; } @@ -240,7 +241,7 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyFileDropTarget, wxFileDropTarget, OnDrop); %name(FileDropTarget) class wxPyFileDropTarget : public wxPyDropTarget { public: - %addtofunc wxPyFileDropTarget "self._setCallbackInfo(self, FileDropTarget)" + %pythonAppend wxPyFileDropTarget "self._setCallbackInfo(self, FileDropTarget)" wxPyFileDropTarget(); void _setCallbackInfo(PyObject* self, PyObject* _class);