(self, widget, direction)
Handle a keyboard shortcut for moving tab positions
Handle a keyboard shortcut for moving tab positions
Handle a keyboard shortcut for moving tab positions
def move_tab(self, widget, direction):
        """Handle a keyboard shortcut for moving tab positions"""
        if self.is_zoomed():
            self.unzoom()

        maker = Factory()
        notebook = self.get_child()

        if not maker.isinstance(notebook, 'Notebook'):
            dbg('not in a notebook, refusing to move tab %s' % direction)
            return

        dbg('moving tab %s' % direction)
        numpages = notebook.get_n_pages()
        page = notebook.get_current_page()
        child = notebook.get_nth_page(page)

        if direction == 'left':
            if page == 0:
                page = numpages
            else:
                page = page - 1
        elif direction == 'right':
            if page == numpages - 1:
                page = 0
            else:
                page = page + 1
        else:
            err('unknown direction: %s' % direction)
            return
        
        notebook.reorder_child(child, page)
def move_tab ( self , widget , direction ) : if self . is_zoomed ( ) : self . unzoom ( ) maker = Factory ( ) notebook = self . get_child ( ) if not maker . isinstance ( notebook , 'Notebook' ) : dbg ( 'not in a notebook, refusing to move tab %s' % direction ) return dbg ( 'moving tab %s' % direction ) numpages = notebook . get_n_pages ( ) page = notebook . get_current_page ( ) child = notebook . get_nth_page ( page ) if direction == 'left' : if page == 0 : page = numpages else : page = page - 1 elif direction == 'right' : if page == numpages - 1 : page = 0 else : page = page + 1 else : err ( 'unknown direction: %s' % direction ) return notebook . reorder_child ( child , page )