예제 #1
0
    def setCurrent(self,canv):
        """Make the specified viewport the current one.

        canv can be either a viewport or viewport number.
        """
        if type(canv) == int and canv in range(len(self.all)):
            canv = self.all[canv]
        if canv == self.current:
            return  # already current

        if canv in self.all:
            if self.current:
                self.current.focus = False
                self.current.updateGL()
            self.current = canv
            self.current.focus = True
            self.current.updateGL()
            toolbar.updateTransparencyButton()
            toolbar.updatePerspectiveButton()
            toolbar.updateLightButton()
예제 #2
0
def transparent(state=True):
    """Set the transparency mode on or off."""
    pf.canvas.setTransparency(state)
    pf.canvas.update()
    toolbar.updateTransparencyButton()
    pf.GUI.processEvents()