def _widget_to_index(self, widget):
        index = 0
        for subwin in self.children:
            if subwin.widget == widget:
                return index, subwin
            index += 1
        return -1, None
dataset/ETHPy150Open ejeschke/ginga/ginga/gtkw/GtkHelp.py/MDIWidget._widget_to_index/original