]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/clip_dnd.i
no real changes
[wxWidgets.git] / wxPython / src / clip_dnd.i
index a66618af31d18489d2b0f321e5a3ee8160bb46c8..ceb7b053ea57289d7c3c63e33eb12762f090a137 100644 (file)
@@ -313,10 +313,7 @@ public:
     %addmethods {
         PyObject* GetFilenames() {
             const wxArrayString& strings = self->GetFilenames();
-            PyObject* list = PyList_New(0);
-            for (size_t x=0; x<strings.GetCount(); x++)
-                PyList_Append(list, PyString_FromString(strings[x]));
-            return list;
+            return wxArrayString2PyList_helper(strings);
         }
     }
 #ifdef __WXMSW__
@@ -596,11 +593,7 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
                                      const wxArrayString& filenames) {
     bool rval = FALSE;
     wxPyTState* state = wxPyBeginBlockThreads();
-    PyObject* list = PyList_New(0);
-    for (size_t i=0; i<filenames.GetCount(); i++) {
-        PyObject* str = PyString_FromString(filenames[i].c_str());
-        PyList_Append(list, str);
-    }
+    PyObject* list = wxArrayString2PyList_helper(filenames);
     if (m_myInst.findCallback("OnDropFiles"))
         rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
     Py_DECREF(list);