def _delete_children(self, pid):

        cookie = 0

        (cid, cookie) = self.control.GetFirstChild(pid, cookie)
        while cid.IsOk():
            # Recursively delete the child's children.
            self._delete_children(cid)

            # Remove the reference to the item's data.
            populated, element = self.control.GetPyData(cid)
            del self._element_to_id_map[self._get_key(element)]
            self.control.SetPyData(cid, None)

            # Next!
            (cid, cookie) = self.control.GetNextChild(pid, cookie)

        self.control.DeleteChildren(pid)

        return

    #### Trait event handlers #################################################
Create a new qt4 app or return an existing one.
dataset/ETHPy150Open enthought/pyface/pyface/viewer/tree_viewer.py/TreeViewer._delete_children--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/util/guisupport.py/get_app_qt4