def __init__(self):
        """Setup rect and image and build structure."""
        ### store rect and build image from it

        self.rect = TEXT_EDITOR_RECT

        self.image = render_rect(*self.rect.size, WINDOW_BG)

        ### draw black border around self.image
        draw_border(self.image, color=BLACK, thickness=1)

        ### create widgets which compose the text editor
        self.create_widgets()

        ### center text editor and append centering method
        ### as window resize setup

        self.center_text_editor()

        APP_REFS.window_resize_setups.append(self.center_text_editor)
Setup rect and image and build structure.
nodezator/textman/editor/main.py