def removeComponent(self, c):
        """Removes a component and its corresponding tab.

        If the tab was selected, the first eligible (visible and enabled)
        remaining tab is selected.

        @param c: the component to be removed.
        """
        if c is not None and c in self._components:
            super(TabSheet, self).removeComponent(c)
            self._keyMapper.remove(c)
            self._components.remove(c)
            if c in self._tabs:
                del self._tabs[c]
            if c == self._selected:
                if len(self._components) == 0:
                    self._selected = None
                else:
                    # select the first enabled and visible tab, if any
                    self.updateSelection()
                    self.fireSelectedTabChange()

            self.requestRepaint()
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/tab_sheet.py/TabSheet.removeComponent/original