- 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;
-}