def update(self):
    ''
    text_images = [self.font.render(t, False, self.fg, self.bg) for t in self.text_lines]
    max_width = max(text_images, key=(lambda x: x.get_width())).get_width()
    self.image = pygame.Surface(((max_width + (2 * (self.border_width + self.padding))), (((text_images[0].get_height() * len(text_images)) + (self.line_spacing * (len(text_images) - 1))) + (2 * (self.border_width + self.padding)))))
    self.image.fill(self.bg)
    if (self.border_width > 0):
        pygame.draw.rect(self.image, self.border_color, (0, 0, self.image.get_width(), self.image.get_height()), self.border_width)
    for (n, t) in enumerate(text_images):
        self.image.blit(t, ((self.border_width + self.padding), ((self.border_width + self.padding) + ((self.line_spacing + t.get_height()) * n))))
    last_rect = self.rect
    self.rect = pygame.Rect(self.position[0], self.position[1], self.image.get_width(), self.image.get_height())
    if (last_rect is None):
        return self.rect
    else:
        return last_rect.union(self.rect)
def update(self):
    
    text_images = [self.font.render(t, False, self.fg, self.bg) for t in self.text_lines]
    max_width = max(text_images, key=(lambda x: x.get_width())).get_width()
    self.image = pygame.Surface(((max_width + (2 * (self.border_width + self.padding))), (((text_images[0].get_height() * len(text_images)) + (self.line_spacing * (len(text_images) - 1))) + (2 * (self.border_width + self.padding)))))
    self.image.fill(self.bg)
    if (self.border_width > 0):
        pygame.draw.rect(self.image, self.border_color, (0, 0, self.image.get_width(), self.image.get_height()), self.border_width)
    for (n, t) in enumerate(text_images):
        self.image.blit(t, ((self.border_width + self.padding), ((self.border_width + self.padding) + ((self.line_spacing + t.get_height()) * n))))
    last_rect = self.rect
    self.rect = pygame.Rect(self.position[0], self.position[1], self.image.get_width(), self.image.get_height())
    if (last_rect is None):
        return self.rect
    else:
        return last_rect.union(self.rect)