'Update the page number for each section
:param self: A TuiTemplateSelection object
:param last_row: The last row of the window
:type self: TuiTemplateSelection
:type last_row: int
:return: None
:rtype: None'

def update_sec_page_map(self, last_row):

    page_number = 0
    row_number = 0
    self.sec_page_map = {}
    for (number, section) in enumerate(self.sections):
        row_number += len(section)
        if (row_number > last_row):
            row_number = 0
            page_number += 1
        self.sec_page_map[number] = page_number
