def reposition_menu_manager_contents(self):
        """Reposition menu manager contents inside rect.

        Used more often when warping to reposition menu
        manager items inside the menu manager self.rect
        (for popup menus), but also used in the
        build_scrolling_objects method to reposition the menu
        contents after creating the new scrolling objects.
        """
        ### get topleft coordinates of the rect, with a
        ### small offset

        offset = 1, 0
        topleft = self.rect.move(offset).topleft

        ### if scrollable, position arrows and scroll area
        ### depending on menu manager initial orientation
        ### and update the topleft coordinate to be used
        ### when repositioning the children

        if self.is_scrollable():

            ## position arrows and scroll area depending
            ## on whether menu manager is used as a
            ## menubar or not

            if self.is_menubar:

                self.left_arrow.rect.topleft = topleft

                self.scroll_area.topleft = self.left_arrow.rect.topright

                self.right_arrow.rect.topleft = self.scroll_area.topright

            else:

                self.up_arrow.rect.topleft = topleft

                self.scroll_area.topleft = self.up_arrow.rect.bottomleft

                self.down_arrow.rect.topleft = self.scroll_area.bottomleft

            ## update topleft to be used to position children
            topleft = self.scroll_area.topleft

        ### position the children, updating the topleft
        ### position of each children depending on the
        ### initial orientation of the menu manager

        ## first define the attribute name whose position
        ## is used to update the topleft coordinates of each
        ## subsequent children, according to whether the
        ## menu manager is used as a menubar or not

        if self.is_menubar:

            # children will be positioned side by side
            attr_name = "topright"

        else:

            # children will be positioned on top of each
            # other
            attr_name = "bottomleft"

        ## finally iterate over each children assigning
        ## its topleft position and them updating it for
        ## the next child

        for child in self.children:

            ## assign topleft
            child.rect.topleft = topleft

            ## update topleft
            topleft = getattr(child.rect, attr_name)
Reposition menu manager contents inside rect.

        Used more often when warping to reposition menu
        manager items inside the menu manager self.rect
        (for popup menus), but also used in the
        build_scrolling_objects method to reposition the menu
        contents after creating the new scrolling objects.
        
nodezator/menu/behaviour.py