+ %extend {
+ // Get the first child of this item. Returns a wxTreeItemId and an
+ // opaque "cookie" value that should be passed to GetNextChild in
+ // order to continue the search.
+ PyObject* GetFirstChild(const wxTreeItemId& item) {
+ long cookie = 0;
+ wxTreeItemId ritem = self->GetFirstChild(item, cookie);
+ wxPyBeginBlockThreads();
+ PyObject* tup = PyTuple_New(2);
+ PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true));
+ PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie));
+ wxPyEndBlockThreads();
+ return tup;
+ }
+
+
+ // Get the next child of this item. The cookie parameter is the 2nd
+ // value returned from GetFirstChild or the previous GetNextChild.
+ // Returns a wxTreeItemId and an opaque "cookie" value that should be
+ // passed to GetNextChild in order to continue the search.
+ PyObject* GetNextChild(const wxTreeItemId& item, long cookie) {
+ wxTreeItemId ritem = self->GetNextChild(item, cookie);
+ wxPyBeginBlockThreads();
+ PyObject* tup = PyTuple_New(2);
+ PyTuple_SET_ITEM(tup, 0, wxPyConstructObject(&ritem, wxT("wxTreeItemId"), true));
+ PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie));
+ wxPyEndBlockThreads();
+ return tup;
+ }
+ }