def __init__(self):
        """Build widget structure for the form."""
        ### build surf and rect for background

        self.image = render_rect(360, 540, WINDOW_BG)
        draw_border(self.image)

        self.rect = self.image.get_rect()

        ### create and store caption

        self.caption = Object2D.from_surface(
            surface=(
                render_text(
                    text=(t.graph_manager.widget_picker.caption),
                    font_height=17,
                    padding=5,
                    foreground_color=WINDOW_FG,
                    border_thickness=2,
                    border_color=WINDOW_FG,
                )
            ),
            coordinates_name="topleft",
            coordinates_value=(self.rect.move(10, 10).topleft),
        )

        ### build option menu
        self.build_option_menu()

        ### build widget subforms
        self.build_widget_subforms()

        ### assign behaviour for exiting the form
        ### (equivalent to setting the running flag to
        ### False, which triggers the exiting of the
        ### loop)
        self.exit_form = partial(setattr, self, "running", False)

        ### create and store form related buttons

        self.cancel_button = Button.from_text(
            text=(t.graph_manager.widget_picker.cancel),
            padding=5,
            foreground_color=BUTTON_FG,
            background_color=BUTTON_BG,
            depth_finish_thickness=1,
            command=self.exit_form,
        )

        self.submit_button = Button.from_text(
            text=(t.graph_manager.widget_picker.submit),
            padding=5,
            foreground_color=BUTTON_FG,
            background_color=BUTTON_BG,
            depth_finish_thickness=1,
            command=self.submit_data,
        )

        ### assign subform according to current
        ### kind of widget selected
        self.update_widget_subform()

        ### center widget picker form and append centering
        ### method as a window resize setup

        self.center_widget_picker_form()

        APP_REFS.window_resize_setups.append(self.center_widget_picker_form)
Build widget structure for the form.
nodezator/editing/widgetpicker/main.py