Moved wxPy_ConvertList function from oglhelpers to helpers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-09-13 19:28:10 +00:00
parent 18ba9da6b9
commit 389c55270a
5 changed files with 133 additions and 39 deletions

View File

@@ -494,9 +494,30 @@ PyObject* wxPyEvent::GetUserData() {
}
//----------------------------------------------------------------------
//---------------------------------------------------------------------------
// Convert a wxList to a Python List
PyObject* wxPy_ConvertList(wxListBase* list, char* className) {
PyObject* pyList;
PyObject* pyObj;
wxObject* wxObj;
wxNode* node = list->First();
bool doSave = wxPyRestoreThread();
pyList = PyList_New(0);
while (node) {
wxObj = node->Data();
pyObj = wxPyConstructObject(wxObj, className);
PyList_Append(pyList, pyObj);
node = node->Next();
}
wxPySaveThread(doSave);
return pyList;
}
//----------------------------------------------------------------------
// Some helper functions for typemaps in my_typemaps.i, so they won't be
// imcluded in every file...
// included in every file...
HELPEREXPORT byte* byte_LIST_helper(PyObject* source) {