'Alter the renderer for a tagged subset of items in the subtree.
@param layout: the layout (renderer)
@param recursive: set this layout recursively for the subtree
@param tag: set this layout only for items with this tag'

def set_layout(self, layout, recursive=False, tag=None):

    if (layout is not None):
        if ((tag is None) or (tag in self.tags)):
            self.renderer = layout
        if recursive:
            for c in self.components:
                if ((tag is None) or (tag in c.tags)):
                    c.set_layout(layout, recursive=recursive, tag=tag)
    return
