def replace(self, old_widget, new_widget):
old_index = self._children.index(old_widget)<EOL>old_size = self._sizes[old_widget]<EOL>with self.hold_updates():<EOL><INDENT>self.remove(old_widget)<EOL>self.insert(new_widget, old_index, old_size)<EOL><DEDENT>
Remove the given old widget from the layout and replace it with the 
given new widget.

The new widget will be given the same size (e.g. the `size` argument to 
`add()`) as the old widget.  That said, the new widget could still take 
up a different amount of space, if it's claim is different.  The layout 
will be repacked automatically if this is the case.