(self, parent, w, h, clockwise)
Recursively rotate "self" into a new paned that'll have "w" x "h" size. Attach it to "parent".

        As discussed in LP#1522542, we should build up the new layout (including the separator positions)
        in a single step. We can't rely on Gtk+ computing the allocation sizes yet, so we have to do the
        computation ourselves and carry the resulting paned sizes all the way down the widget tree.
Recursively rotate "self" into a new paned that'll have "w" x "h" size. Attach it to "parent".
Recursively rotate self into a new paned that ll have w x h size . Attach it to parent .
def rotate_recursive(self, parent, w, h, clockwise):
        """
        Recursively rotate "self" into a new paned that'll have "w" x "h" size. Attach it to "parent".

        As discussed in LP#1522542, we should build up the new layout (including the separator positions)
        in a single step. We can't rely on Gtk+ computing the allocation sizes yet, so we have to do the
        computation ourselves and carry the resulting paned sizes all the way down the widget tree.
        """
        maker = Factory()
        handle_size = self.get_handlesize()

        if isinstance(self, HPaned):
            container = VPaned()
            reverse = not clockwise
        else:
            container = HPaned()
            reverse = clockwise

        container.ratio = self.ratio
        children = self.get_children()
        if reverse:
            container.ratio = 1 - container.ratio
            children.reverse()

        if isinstance(self, HPaned):
            w1 = w2 = w
            h1 = pos = self.position_by_ratio(h, handle_size, container.ratio)
            h2 = max(h - h1 - handle_size, 0)
        else:
            h1 = h2 = h
            w1 = pos = self.position_by_ratio(w, handle_size, container.ratio)
            w2 = max(w - w1 - handle_size, 0)

        container.set_pos(pos)
        parent.add(container)

        if maker.isinstance(children[0], 'Terminal'):
            children[0].get_parent().remove(children[0])
            container.add(children[0])
        else:
            children[0].rotate_recursive(container, w1, h1, clockwise)

        if maker.isinstance(children[1], 'Terminal'):
            children[1].get_parent().remove(children[1])
            container.add(children[1])
        else:
            children[1].rotate_recursive(container, w2, h2, clockwise)
def rotate_recursive ( self , parent , w , h , clockwise ) : maker = Factory ( ) handle_size = self . get_handlesize ( ) if isinstance ( self , HPaned ) : container = VPaned ( ) reverse = not clockwise else : container = HPaned ( ) reverse = clockwise container . ratio = self . ratio children = self . get_children ( ) if reverse : container . ratio = 1 - container . ratio children . reverse ( ) if isinstance ( self , HPaned ) : w1 = w2 = w h1 = pos = self . position_by_ratio ( h , handle_size , container . ratio ) h2 = max ( h - h1 - handle_size , 0 ) else : h1 = h2 = h w1 = pos = self . position_by_ratio ( w , handle_size , container . ratio ) w2 = max ( w - w1 - handle_size , 0 ) container . set_pos ( pos ) parent . add ( container ) if maker . isinstance ( children [ 0 ] , 'Terminal' ) : children [ 0 ] . get_parent ( ) . remove ( children [ 0 ] ) container . add ( children [ 0 ] ) else : children [ 0 ] . rotate_recursive ( container , w1 , h1 , clockwise ) if maker . isinstance ( children [ 1 ] , 'Terminal' ) : children [ 1 ] . get_parent ( ) . remove ( children [ 1 ] ) container . add ( children [ 1 ] ) else : children [ 1 ] . rotate_recursive ( container , w2 , h2 , clockwise )