'Resize the window if the dimensions have been changed
:param self: A TuiApSel object
:type self: TuiApSel
:param screen: A curses window object
:type screen: _curses.curses.window
:param ap_info: An ApDisplayInfo object
:type ap_info: ApDisplayInfo'

def resize_window(self, screen, ap_info):

    if (screen.getmaxyx() != (ap_info.max_h, ap_info.max_l)):
        (ap_info.max_h, ap_info.max_l) = screen.getmaxyx()
        if ((ap_info.max_h < (10 + 4)) or (ap_info.max_l < (6 + 3))):
            box = curses.newwin(ap_info.max_h, ap_info.max_l, 0, 0)
            box.box()
            ap_info.box = box
            self.renew_box = True
            return
        elif self.renew_box:
            screen.erase()
            box = curses.newwin((ap_info.max_h - 9), (ap_info.max_l - 5), 4, 3)
            box.box()
            ap_info.box = box
            self.renew_box = False
        ap_info.box.resize((ap_info.max_h - 9), (ap_info.max_l - 5))
        box_height = ap_info.box.getmaxyx()[0]
        ap_info.max_row = (box_height - 2)
        ap_info.pos = 1
        ap_info.page_number = 1
