def focus_if_within_boundaries(self, mouse_pos):
        """Check whether to give menu manager focus.

        This method should be used when the menu manager is
        used as a popup menu to determine whether the mouse
        click happened within the boundaries rect defined for
        the existence of the menu, in which case the menu
        is shown.

        mouse_pos (2-tuple of integers)
            represent position of the mouse cursor. It is the
            position to which to warp the menu manager.
        """
        ### if the mouse is inside the boundaries rect,
        ### warp the menu to its position and make the menu
        ### the new loop holder

        if self.boundaries_rect.collidepoint(mouse_pos):

            self.warp(mouse_pos)
            raise SwitchLoopException(self)
Check whether to give menu manager focus.

        This method should be used when the menu manager is
        used as a popup menu to determine whether the mouse
        click happened within the boundaries rect defined for
        the existence of the menu, in which case the menu
        is shown.

        mouse_pos (2-tuple of integers)
            represent position of the mouse cursor. It is the
            position to which to warp the menu manager.
        
nodezator/menu/behaviour.py