(self, widget, clockwise)
Rotate children in this window
Rotate children in this window
Rotate children in this window
def rotate(self, widget, clockwise):
        """Rotate children in this window"""
        if self.is_zoomed():
            self.unzoom()
            while Gtk.events_pending():
                Gtk.main_iteration_do(False)

        self.set_pos_by_ratio = True
        maker = Factory()
        child = self.get_child()

        # If our child is a Notebook, reset to work from its visible child
        if maker.isinstance(child, 'Notebook'):
            pagenum = child.get_current_page()
            child = child.get_nth_page(pagenum)

        if maker.isinstance(child, 'Paned'):
            parent = child.get_parent()
            # Need to get the allocation before we remove the child,
            # otherwise _sometimes_ we get incorrect values.
            alloc = child.get_allocation()
            parent.remove(child)
            child.rotate_recursive(parent, alloc.width, alloc.height, clockwise)

            self.show_all()
            while Gtk.events_pending():
                Gtk.main_iteration_do(False)
            widget.grab_focus()

        self.set_pos_by_ratio = False
def rotate ( self , widget , clockwise ) : if self . is_zoomed ( ) : self . unzoom ( ) while Gtk . events_pending ( ) : Gtk . main_iteration_do ( False ) self . set_pos_by_ratio = True maker = Factory ( ) child = self . get_child ( ) # If our child is a Notebook, reset to work from its visible child if maker . isinstance ( child , 'Notebook' ) : pagenum = child . get_current_page ( ) child = child . get_nth_page ( pagenum ) if maker . isinstance ( child , 'Paned' ) : parent = child . get_parent ( ) # Need to get the allocation before we remove the child, # otherwise _sometimes_ we get incorrect values. alloc = child . get_allocation ( ) parent . remove ( child ) child . rotate_recursive ( parent , alloc . width , alloc . height , clockwise ) self . show_all ( ) while Gtk . events_pending ( ) : Gtk . main_iteration_do ( False ) widget . grab_focus ( ) self . set_pos_by_ratio = False