def gather_arrows(self, menu, all_arrows):
        """Gather arrows from menu manager to active branch.

        Works recursively from the menu to the active branch
        (if there is one, otherwise only the arrows in the
        menu manager itself are gathered, if it has arrows).

        menu (either the menu.main.MenuManager or a
             a menu.submenu.main.Menu instance)
            object which may have an 'arrows' attribute
            containing arrows.

        all_arrows (list)
            contains arrows found while iterating the
            hierarchy recursively (might also be empty if
            none was found).

        We take measures to only gather visible arrows,
        that is, those on the top menu and/or the active
        branch, if there's one. This is because if a menu
        isn't a top menu or is in the active branch, than it
        can't be visible and thus the user won't acknowledge
        its existence, much less interact with it.
        """
        ### check whether the menu object has arrows
        try:
            arrows = menu.arrows

        ### if it doesn't, just pass
        except AttributeError:
            pass

        ### otherwise, check preliminary conditions for the
        ### arrows to be taken into account

        else:

            ### for its arrows to be added, the menu must
            ### either:
            ### 1) be the MenuManager instance
            ### 2) be the active menu
            ### 3) its top parent must the active menu and
            ###    it should be expanded

            if (
                menu is self
                or menu is self.active_menu
                or (self.top_menu_is_active(menu) and menu.is_expanded)
            ):

                ## since one of the preliminary conditions
                ## was met, we are ready to append the
                ## arrows to the all_arrows list, but
                ## before doing that, if the menu is not
                ## self (that is, not the MenuManager
                ## instance), we must eliminate past arrows
                ## from the list if the mouse is touching
                ## the body of the menu;
                ## this is done because if the cursor is on
                ## the body of a expanded submenu, it means
                ## we are not interested in the arrows
                ## before it in the hierarchy;

                if menu is not self:

                    ## get the rect in the body attribute
                    rect = menu.body.rect

                    ## use it to check for the collision
                    if rect.collidepoint(self.mouse_pos):
                        all_arrows.clear()

                ## now you can finally append the arrows
                ## (by extending the list with them)
                all_arrows.extend(arrows)

        ### also check the menu children for the presence of
        ### arrows

        try:
            children = menu.children

        except AttributeError:
            pass

        else:

            for child in children:

                all_arrows = self.gather_arrows(child, all_arrows)

        ### finally, return the arrows gathered
        return all_arrows
Gather arrows from menu manager to active branch.

        Works recursively from the menu to the active branch
        (if there is one, otherwise only the arrows in the
        menu manager itself are gathered, if it has arrows).

        menu (either the menu.main.MenuManager or a
             a menu.submenu.main.Menu instance)
            object which may have an 'arrows' attribute
            containing arrows.

        all_arrows (list)
            contains arrows found while iterating the
            hierarchy recursively (might also be empty if
            none was found).

        We take measures to only gather visible arrows,
        that is, those on the top menu and/or the active
        branch, if there's one. This is because if a menu
        isn't a top menu or is in the active branch, than it
        can't be visible and thus the user won't acknowledge
        its existence, much less interact with it.
        
nodezator/menu/scroll.py