'Return the text widget (or similar) to give focus to'

def get_control(self):

    page_control = self.shellwidget._page_control
    if (page_control and page_control.isVisible()):
        return page_control
    else:
        return self.shellwidget._control
