コード例 #1
0
    def set_layout(self, layout, window):
        """ Applies a DockLayout to the window.
        """
        logger.debug("set_layout: %s" % layout)
        
        if hasattr(layout, "perspective"):
            self._set_layout_from_aui(layout, window)
            return

        # Perform the layout. This will assign fixed sizes to the dock widgets
        # to enforce size constraints specified in the PaneItems.
        for name, direction in AREA_MAP.items():
            sublayout = getattr(layout, name)
            if sublayout:
                self.set_layout_for_area(sublayout, direction)

        self._add_dock_panes(window)