(self, widget, vertical=True, cwd=None, sibling=None, widgetfirst=True)
Split the axis of a terminal inside us
Split the axis of a terminal inside us
Split the axis of a terminal inside us
def split_axis(self, widget, vertical=True, cwd=None, sibling=None, widgetfirst=True):
        """Split the axis of a terminal inside us"""
        dbg('called for widget: %s' % widget)
        order = None
        page_num = self.page_num(widget)
        if page_num == -1:
            err('Notebook::split_axis: %s not found in Notebook' % widget)
            return

        label = self.get_tab_label(widget)
        self.remove(widget)

        maker = Factory()
        if vertical:
            container = maker.make('vpaned')
        else:
            container = maker.make('hpaned')

        self.get_toplevel().set_pos_by_ratio = True

        if not sibling:
            sibling = maker.make('terminal')
            sibling.set_cwd(cwd)
            if self.config['always_split_with_profile']:
                sibling.force_set_profile(None, widget.get_profile())
            sibling.spawn_child()
            if widget.group and self.config['split_to_group']:
                sibling.set_group(None, widget.group)
        elif self.config['always_split_with_profile']:
            sibling.force_set_profile(None, widget.get_profile())

        self.insert_page(container, None, page_num)
        self.set_tab_detachable(container, True)
        self.child_set_property(container, 'tab-expand', True)
        self.child_set_property(container, 'tab-fill', True)
        self.set_tab_reorderable(container, True)
        self.set_tab_label(container, label)
        self.show_all()

        order = [widget, sibling]
        if widgetfirst is False:
            order.reverse()

        for terminal in order:
            container.add(terminal)
        self.set_current_page(page_num)

        self.show_all()

        while Gtk.events_pending():
            Gtk.main_iteration_do(False)
        self.get_toplevel().set_pos_by_ratio = False

        GObject.idle_add(terminal.ensure_visible_and_focussed)
def split_axis ( self , widget , vertical = True , cwd = None , sibling = None , widgetfirst = True ) : dbg ( 'called for widget: %s' % widget ) order = None page_num = self . page_num ( widget ) if page_num == - 1 : err ( 'Notebook::split_axis: %s not found in Notebook' % widget ) return label = self . get_tab_label ( widget ) self . remove ( widget ) maker = Factory ( ) if vertical : container = maker . make ( 'vpaned' ) else : container = maker . make ( 'hpaned' ) self . get_toplevel ( ) . set_pos_by_ratio = True if not sibling : sibling = maker . make ( 'terminal' ) sibling . set_cwd ( cwd ) if self . config [ 'always_split_with_profile' ] : sibling . force_set_profile ( None , widget . get_profile ( ) ) sibling . spawn_child ( ) if widget . group and self . config [ 'split_to_group' ] : sibling . set_group ( None , widget . group ) elif self . config [ 'always_split_with_profile' ] : sibling . force_set_profile ( None , widget . get_profile ( ) ) self . insert_page ( container , None , page_num ) self . set_tab_detachable ( container , True ) self . child_set_property ( container , 'tab-expand' , True ) self . child_set_property ( container , 'tab-fill' , True ) self . set_tab_reorderable ( container , True ) self . set_tab_label ( container , label ) self . show_all ( ) order = [ widget , sibling ] if widgetfirst is False : order . reverse ( ) for terminal in order : container . add ( terminal ) self . set_current_page ( page_num ) self . show_all ( ) while Gtk . events_pending ( ) : Gtk . main_iteration_do ( False ) self . get_toplevel ( ) . set_pos_by_ratio = False GObject . idle_add ( terminal . ensure_visible_and_focussed )