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);
static PyObject * wxFileDataObject_GetFilenames(wxFileDataObject *self) {
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);
}
static PyObject *_wrap_wxFileDataObject_GetFilenames(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;