def __init__(
        self,
        value="",
        font_height=ENC_SANS_BOLD_FONT_HEIGHT,
        font_path=ENC_SANS_BOLD_FONT_PATH,
        width=200,
        name="search_box",
        on_input=return_untouched,
        coordinates_name="topleft",
        coordinates_value=(0, 0),
        foreground_color=BLACK,
        background_color=WHITE,
    ):
        """Perform setups and assign data for reuse.

        Parameters
        ==========
        value (string)
            initial value of the widget.
        font_height (integer)
            desired font height in pixels.
        font_path (string, defaults to "default")
            represents font style. Check local
            font.py module for available styles. In doubt
            use 'default' for default font.
        width (integer)
            width of the widget.
        name (string)
            an arbitrary name to help identify the widget.
        on_input (callable)
            callable to be executed whenever the value
            changes (when characters are entered/deleted);
            the callable must take a single argument, which
            is the value (text) in the search box.
        coordinates_name (string)
            represents attribute name of rect wherein
            to store the position information from the
            coordinates value parameter.
        coordinates_value (2-tuple of integers)
            represents a position in 2d space; the values of
            x and y axes, respectively.
        foreground_color, background_color
            (tuple/list/pygame.color.Color instance)
            A tuple or list of r, g, b values which are
            integers ranging from 0 to 255. For the
            background color, an optional fourth value
            can be passed, which is an integer in the
            same range as the others, representing the
            image opacity (0 for full transparency and
            255 for full opacity).
        """
        ### ensure value argument received is a string

        if type(value) is not str:

            raise TypeError("'value' received must be of 'str' type")

        ### convert the colors passed into tuples for
        ### simplicity (since colors can be given as
        ### instances from other classes like
        ### pygame.Color and builtin lists too)

        background_color = tuple(background_color)
        foreground_color = tuple(foreground_color)

        ### store some of the arguments in their own
        ### attributes

        self.name = name
        self.on_input = on_input

        ### create and position a rect for this entry

        self.rect = Rect(0, 0, width, font_height)

        setattr(self.rect, coordinates_name, coordinates_value)

        ### create a background surface for the widget
        self.background = render_rect(*self.rect.size, background_color)

        ### also store a copy of it as the image
        ### representing this widget
        self.image = self.background.copy()

        ### gather the text rendering settings in a
        ### dictionary

        render_settings = {
            "font_height": font_height,
            "font_path": font_path,
            "foreground_color": foreground_color,
            "background_color": background_color,
        }

        ### instantiate the entry cursor class, which is
        ### responsible for holding and managing the text
        ### of the entry during edition (while the actual
        ### value keeps stored in the 'value' attribute,
        ### until the edition in the entry is confirmed
        ### or the value is set with self.set())

        cursor = self.cursor = EntryCursor(
            value,
            render_settings,
            self,
            get_contrasting_bw(background_color),
        )

        ###
        self.reposition_cursor()

        ###

        for method_name in (
            'update',
            'go_left',
            'go_right',
            'go_to_beginning',
            'go_to_end',
        ):

            method = getattr(cursor, method_name)
            setattr(self, method_name, method)

        ###

        for method_name in (
            'add_text',
            'delete_previous_word',
            'delete_previous',
            'delete_under',
        ):

            method = getattr(cursor, method_name)
            wrapped_method = self.report_on_input(method)
            setattr(self, method_name, wrapped_method)
Perform setups and assign data for reuse.

        Parameters
        ==========
        value (string)
            initial value of the widget.
        font_height (integer)
            desired font height in pixels.
        font_path (string, defaults to "default")
            represents font style. Check local
            font.py module for available styles. In doubt
            use 'default' for default font.
        width (integer)
            width of the widget.
        name (string)
            an arbitrary name to help identify the widget.
        on_input (callable)
            callable to be executed whenever the value
            changes (when characters are entered/deleted);
            the callable must take a single argument, which
            is the value (text) in the search box.
        coordinates_name (string)
            represents attribute name of rect wherein
            to store the position information from the
            coordinates value parameter.
        coordinates_value (2-tuple of integers)
            represents a position in 2d space; the values of
            x and y axes, respectively.
        foreground_color, background_color
            (tuple/list/pygame.color.Color instance)
            A tuple or list of r, g, b values which are
            integers ranging from 0 to 255. For the
            background color, an optional fourth value
            can be passed, which is an integer in the
            same range as the others, representing the
            image opacity (0 for full transparency and
            255 for full opacity).
        
nodezator/our3rdlibs/searchbox.py