def replace(self, old, new):
        self.children.remove(new)
        old_index = self.children.index(old)
        old.delete()
        self.children.insert(old_index, new)
Replace the "old" widget with the "new" one.
dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/element.py/Element.replace