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

18.4. ColorSliders.__createWidgets()

For the widget layout, see Section 18, “class ColorSliders: Color model parameter sliders”.

huey
# - - -   C o l o r S l i d e r s . _ _ c r e a t e W i d g e t s

    def __createWidgets ( self ):
        """Create and grid all internal widgets.
        """
        #-- 1 --
        # [ self  :=  self with a new Label created and gridded
        #   self.__topLabel  :=  that new Label ]
        # 
        self.__topLabel  =  Label ( self,
            font=BUTTON_FONT,
            text="Adjust colors here:" )
        rowx  =  0
        self.__topLabel.grid ( row=rowx, column=0, columnspan=3,
            sticky=E+W )

Next we add a horizontal group of parameter slider widgets: see Section 19, “class ParamSlider: Scale widget for a color model parameter”.

huey
        #-- 2 --
        self.__sliderList  =  []

        # [ self  :=  self with N_PARAMS new ParamSlider widgets
        #             added and gridded
        #   self.__sliderList  +:=  those widgets ]
        rowx  +=  1
        for  paramx in range ( N_PARAMS ):
            paramSlider  =  ParamSlider ( self, self.__model,
                self.__color, paramx, self.__sliderHandler )
            paramSlider.grid ( row=rowx, column=paramx, sticky=E+W )
            self.__sliderList.append ( paramSlider )