def configure_wstype(self, wstype):
        old_widget = self.nb
        self.vbox.remove(old_widget)

        # remember which tab was on top
        idx = old_widget.get_index()

        self._set_wstype(wstype)
        self.vbox.add_widget(self.nb, stretch=1)

        for child in list(old_widget.get_children()):
            # TODO: sort by previous index so they get added to the
            # new widget in the same order
            title = child.extdata.get('tab_title', '')
            old_widget.remove(child)
            self.nb.add_widget(child, title=title)
            child.show()

        # restore focus to widget that was on top
        if idx >= 0:
            self.nb.set_index(idx)
        self.focus_index()
dataset/ETHPy150Open ejeschke/ginga/ginga/gw/Desktop.py/Workspace.configure_wstype/original