(self)
Make sure that we're visible and focussed
Make sure that we're visible and focussed
Make sure that we re visible and focussed
def ensure_visible_and_focussed(self):
        """Make sure that we're visible and focussed"""
        window = self.get_toplevel()
        try:
            topchild = window.get_children()[0]
        except IndexError:
            dbg('unable to get top child')    
            return
        maker = Factory()

        if maker.isinstance(topchild, 'Notebook'):
            # Find which page number this term is on
            tabnum = topchild.page_num_descendant(self)
            # If terms page number is not the current one, switch to it
            current_page = topchild.get_current_page()
            if tabnum != current_page:
                topchild.set_current_page(tabnum)

        self.grab_focus()
def ensure_visible_and_focussed ( self ) : window = self . get_toplevel ( ) try : topchild = window . get_children ( ) [ 0 ] except IndexError : dbg ( 'unable to get top child' ) return maker = Factory ( ) if maker . isinstance ( topchild , 'Notebook' ) : # Find which page number this term is on tabnum = topchild . page_num_descendant ( self ) # If terms page number is not the current one, switch to it current_page = topchild . get_current_page ( ) if tabnum != current_page : topchild . set_current_page ( tabnum ) self . grab_focus ( )