def record_sizes(self):
        """Record sizes of all container widgets in the layout.
        The sizes are recorded in the `params` mappings in the layout.
        """
        for rec in self.node.values():
            w = rec.widget
            wd, ht = w.get_size()

            rec.params.update(dict(name=rec.name, width=wd, height=ht))

            if rec.kind in ('hpanel', 'vpanel'):
                sizes = w.get_sizes()
                rec.params.update(dict(sizes=sizes))

            if rec.kind in ('ws',):
                # record ws type
                # TODO: record positions of subwindows
                rec.params.update(dict(wstype=rec.ws.wstype))

            if rec.kind == 'top':
                # record position for top-level widgets as well
                x, y = w.get_pos()
                if x is not None and y is not None:
                    # we don't always get reliable information about position
                    rec.params.update(dict(xpos=x, ypos=y))
Record sizes of all container widgets in the layout.
        The sizes are recorded in the `params` mappings in the layout.