def create_option_menu_subform(self, kind_of_content):
        """Create option menu subform for given kind.

        Parameters
        ==========
        kind_of_content (string)
            either "strings" or "intfloats", which are
            the available kinds of content here (the
            option menu actually also accepts None,
            True and False).
        """
        ### ensure the value of kind_of_content is within
        ### the allowed ones
        assert kind_of_content in ("strings", "intfloats")

        ### depending on the kind of content, define
        ### available default options; the first value
        ### in the options is used as the initial value
        ### and the whole list is used as the default
        ### options in the list widget;

        if kind_of_content == "strings":

            available_options = ["option_a", "option_b", "option_c"]

            default_factory = lambda: choice(ascii_lowercase)

        elif kind_of_content == "intfloats":

            available_options = [0, 1, 2]
            default_factory = lambda: choice(range(100))

        ### define an starting offset
        offset = 5, 30

        ### create list to hold widget
        option_menu_subform = List2D()

        ### instantiate 'value' argument widgets

        ## define argument name
        arg_name = "value"

        ## instantiate and store text object

        text_obj = get_text_obj(reference_rect=self.rect, offset=offset, text=arg_name)

        option_menu_subform.append(text_obj)

        ## define needed arguments, instantiate and store
        ## option menu widget for the option menu 'value'

        # define widget name
        widget_name = arg_name

        offset = 80, offset[1] + 5
        coordinates_name = "topleft"
        coordinates_value = self.rect.move(offset).topleft

        value_option_menu = OptionMenu(
            name=widget_name,
            loop_holder=self,
            value=available_options[0],
            options=available_options,
            draw_on_window_resize=self.draw,
            coordinates_name=coordinates_name,
            coordinates_value=coordinates_value,
        )

        option_menu_subform.append(value_option_menu)

        ### instantiate 'options' argument widgets

        ## define argument name
        arg_name = "options"

        ## update offset
        offset = 5, offset[1] + 25

        ## instantiate and store text object

        text_obj = get_text_obj(reference_rect=self.rect, offset=offset, text=arg_name)

        option_menu_subform.append(text_obj)

        ## define needed arguments, instantiate and store
        ## list widget for the option menu 'options'

        # define widget name
        widget_name = arg_name

        # define position data

        offset = 80, offset[1] + 5
        coordinates_name = "topleft"
        coordinates_value = self.rect.move(offset).topleft

        # define widget factory

        if kind_of_content == "strings":

            widget_factory = partial(
                StringEntry,
                loop_holder=self,
                draw_on_window_resize=self.draw,
                name="option_item",
            )

        elif kind_of_content == "intfloats":

            widget_factory = partial(
                IntFloatEntry,
                loop_holder=self,
                draw_on_window_resize=self.draw,
                name="option_item",
                allow_none=True,
            )

        # instantiate and store widget list

        options_list_widget = ListWidget(
            name=widget_name,
            value=available_options,
            min_len=1,
            widget_factory=widget_factory,
            default_factory=default_factory,
            quantity_command=self.reposition_form_elements,
            coordinates_name=coordinates_name,
            coordinates_value=coordinates_value,
        )

        option_menu_subform.append(options_list_widget)

        ### create custom command for the list widget and
        ### assign it to its 'command' attribute

        def command():
            """Updates values in the option menu.

            Values of the option menu are updated with
            the values in the list widget whenever the user
            edits values in the list widget.
            """
            ### retrieve values

            list_widget_values = options_list_widget.get()
            option_menu_options = value_option_menu.options

            ### if options in the list widget are different
            ### (or in different order) than those on the
            ### option menu, update the options on the
            ### option menu so they are equal

            if option_menu_options != list_widget_values:

                option_menu_value = value_option_menu.get()

                value = (
                    option_menu_value
                    if option_menu_value in list_widget_values
                    else list_widget_values[0]
                )

                value_option_menu.reset_value_and_options(
                    value=value, options=(list_widget_values)
                )

        options_list_widget.command = command

        ### format the subform key according to the kind
        ### of content used

        subform_key = "option_menu_with_{}".format(kind_of_content)

        ### finally store the subform list in the map
        self.subform_map[subform_key] = option_menu_subform
Create option menu subform for given kind.

        Parameters
        ==========
        kind_of_content (string)
            either "strings" or "intfloats", which are
            the available kinds of content here (the
            option menu actually also accepts None,
            True and False).
        
nodezator/editing/widgetpicker/subforms.py