%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__
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);