def __init__(self):
        """Create support objects for the patterns mode."""
        ### create a "Pattern:" label to indicate the
        ### option menu for choosing patterns

        self.pattern_label = Object2D.from_surface(
            surface=(
                render_text(
                    text="Pattern:",
                    font_height=ENC_SANS_BOLD_FONT_HEIGHT,
                    padding=5,
                    foreground_color=WINDOW_FG,
                    background_color=WINDOW_BG,
                )
            ),
        )

        ### create option menu from which to choose patterns

        pattern_names = sorted(PATTERN_DRAWING_MAP.keys())

        clamp_area = self.rect

        self.pattern_options = OptionMenu(
            loop_holder=self,
            value=pattern_names[0],
            options=pattern_names,
            clamp_area=clamp_area,
            command=self.redraw_pattern,
            draw_on_window_resize=self.patterns_draw,
        )

        ### create a button to redraw/change the pattern

        self.redraw_pattern_button = Object2D.from_surface(
            surface=(
                render_text(
                    text="Redraw",
                    font_height=ENC_SANS_BOLD_FONT_HEIGHT,
                    padding=5,
                    foreground_color=BUTTON_FG,
                    background_color=BUTTON_BG,
                    depth_finish_thickness=1,
                )
            ),
            on_mouse_release=(get_oblivious_callable(self.redraw_pattern)),
        )

        ### placeholder attribute for a generator closing
        ### method
        self.close_generator = empty_function
Create support objects for the patterns mode.
nodezator/colorsman/viewer/modes/patterns/main.py