def mouse_method_on_collision(self, method_name, event):
        """Invoke inner widget if it collides with mouse.

        Parameters
        ==========

        method_name (string)
            name of method to be called on the colliding
            widget.
        event (event object of MOUSEBUTTON[...] type)
            it is required in order to comply with
            mouse interaction protocol used; here we
            use it to retrieve the position of the
            mouse when the first button was released.

            Check pygame.event module documentation on
            pygame website for more info about this event
            object.
        """
        ### retrieve position from attribute in event obj
        mouse_pos = event.pos

        ### chain all widgets together

        other_widgets = (
            self.widget_kind_options,
            self.cancel_button,
            self.submit_button,
        )

        objs = chain(self.widget_subform, other_widgets)

        for obj in objs:

            if obj.rect.collidepoint(mouse_pos):

                colliding_obj = obj
                break

        else:
            colliding_obj = None

        if colliding_obj:

            try:
                method = getattr(colliding_obj, method_name)

            except AttributeError:
                pass
            else:
                method(event)
Invoke inner widget if it collides with mouse.

        Parameters
        ==========

        method_name (string)
            name of method to be called on the colliding
            widget.
        event (event object of MOUSEBUTTON[...] type)
            it is required in order to comply with
            mouse interaction protocol used; here we
            use it to retrieve the position of the
            mouse when the first button was released.

            Check pygame.event module documentation on
            pygame website for more info about this event
            object.
        
nodezator/editing/widgetpicker/main.py