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

30.1. KeyRow.__init__()

cbchistlib.py
# - - -   K e y R o w . _ _ i n i t _ _

    def __init__(self, cbcHist):
        '''Constructor.
        '''
        #-- 1
        # [ self  :=  a new Row instance with cbcHist=(cbcHist) ]
        Row.__init__(self, cbcHist)

Our obligations to the parent class are twofold: set up the row label, and fill the cells of the logical row. For the row label, see Section 35, “class HeadRowLabel: Row label for a heading”.

cbchistlib.py
        #-- 2
        # [ self._rowLabel  :=  a new HeadRowLabel with text
        #                       "Years" ]
        self._rowLabel = HeadRowLabel("Years")

The balance of the row is a list of instances of the class defined in Section 38, “class LabelCell: Column label cell”.

cbchistlib.py
        #-- 3
        # [ self._cellList  :=  a list of LabelCell instances
        #       containing the column labels of self.cbcHist ]
        self._cellList = [ LabelCell(label)
                           for label in self.cbcHist.genColLabels() ]