def set(
        self,
        value,
        custom_command=True,
        update_image=True,
    ):
        """Set the value of the widget.

        value (string or tuple of strings representing paths)
            new value for widget.
        custom_command (boolean)
            indicates whether the custom command stored
            upon instantiation should be called after
            updating the value.
        update_image (boolean)
            indicates whether the update_image method
            should be called after updating the value.
        """
        ### validate value received
        try:
            self.validate_value(value)

        ### if it doesn't validate, report error and exit
        ### method by returning

        except (TypeError, ValueError) as err:

            print(err)
            return

        ### changes are only performed if the new value is
        ### indeed different from the current one

        if self.value != value:

            ### store new value
            self.value = value

            ### reset index
            self.path_index = 0

            ### reset index value and max value

            entry = self.index_entry

            entry.set(0, False)

            max_value = 0 if isinstance(value, str) else len(value) - 1

            entry.set_range(0, max_value)

            ### if requested, execute the custom command
            if custom_command:
                self.command()

            ### if requested, update the widget image
            if update_image:
                self.update_image()
Set the value of the widget.

        value (string or tuple of strings representing paths)
            new value for widget.
        custom_command (boolean)
            indicates whether the custom command stored
            upon instantiation should be called after
            updating the value.
        update_image (boolean)
            indicates whether the update_image method
            should be called after updating the value.
        
nodezator/widget/pathpreview/base.py