def _remove(self, nchild, delete=False):
        subwins = list(self.widget.subWindowList())
        l = [ sw.widget() for sw in subwins ]
        try:
            idx = l.index(nchild)
            subwin = subwins[idx]
        except (IndexError, __HOLE__) as e:
            subwin = None

        if subwin is not None:
            self.widget.removeSubWindow(subwin)
            subwin.deleteLater()

        nchild.setParent(None)
        if delete:
            nchild.deleteLater()
dataset/ETHPy150Open ejeschke/ginga/ginga/qtw/Widgets.py/MDIWidget._remove