+ %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 = new wxTreeItemId(self->GetFirstChild(item, cookie));
+ bool blocked = 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(blocked);
+ 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 = new wxTreeItemId(self->GetNextChild(item, cookie));
+ bool blocked = 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(blocked);
+ return tup;
+ }
+ }