def _doenter(self, value, *attrs):
        """
        "enter" a special item resulting in a new notebook tab
        """
        panel = self.GetParent()
        nb = panel.GetParent()
        frame = nb.GetParent()
        current = nb.GetSelection()
        count = nb.GetPageCount()
        try: # if we want to enter something non-iterable, e.g. a function
            if current + 1 == count and value is not self.input: # we have an event in the last tab
                frame._add_notebook(value, *attrs)
            elif value != self.input: # we have to delete all tabs newer than [panel] first
                for i in range(count-1, current, -1): # some tabs don't close if we don't close in *reverse* order
                    nb.DeletePage(i)
                frame._add_notebook(value)
        except __HOLE__ as exc:
            if exc.__class__.__module__ == "exceptions":
                msg = "%s: %s" % (exc.__class__.__name__, exc)
            else:
                msg = "%s.%s: %s" % (exc.__class__.__module__, exc.__class__.__name__, exc)
            frame.SetStatusText(msg)
dataset/ETHPy150Open ipython/ipython-py3k/IPython/deathrow/igrid.py/IGridGrid._doenter