Next / Previous / Contents / TCC Help System / NM Tech homepage

18.2. ColorSliders.setColor(): Change the displayed color

This method is called to change the color currently being displayed in this widget.

huey
# - - -   C o l o r S l i d e r s . s e t C o l o r

    def setColor ( self, color ):
        """Change the displayed color.
        """

Because each ParamSlider widget knows which parameter of the model is displaying, all we have to do is tell each one the new color; see Section 19.3, “ParamSlider.setColor(): Change the current color”.

huey
        #-- 1 --
        self.__color  =  color

        #-- 2 --
        for  paramx in range ( N_PARAMS ):
            #-- 1 body --
            # [ self.__sliderList[paramx]  :=  self.__sliderList[paramx]
            #       displaying the (paramx)th parameter of (color)
            #       using its current color model ]
            self.__sliderList[paramx].setColor ( color )