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:
@@ -92,42 +92,10 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Convert a wxList to a Python List
|
||||
|
||||
#include <ogl.h>
|
||||
|
||||
PyObject* wxPy_ConvertList(wxList* 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();
|
||||
// printf("%s class at %x : %x\n", wxObj->GetClassInfo()->GetClassName(), (void*)wxObj, (void*)((wxShape*)wxObj)->GetParent());
|
||||
pyObj = wxPyConstructObject(wxObj, className);
|
||||
PyList_Append(pyList, pyObj);
|
||||
node = node->Next();
|
||||
}
|
||||
// for (int x=0; x<PyList_Size(pyList); x++) {
|
||||
// PyObject* obj = PyList_GetItem(pyList, x);
|
||||
// char* attr = PyString_AsString(PyObject_GetAttrString(obj, "this"));
|
||||
// PyObject* par = PyObject_CallMethod(obj, "GetParent", NULL);
|
||||
// char* parent;
|
||||
// if (par != Py_None)
|
||||
// parent = PyString_AsString(PyObject_GetAttrString(par, "this"));
|
||||
// else
|
||||
// parent = "None";
|
||||
// printf("obj.this = %s obj.GetParent().this = %s\n", attr, parent);
|
||||
// }
|
||||
// printf("--------\n");
|
||||
wxPySaveThread(doSave);
|
||||
return pyList;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user