#NEWLINE# def replaceElement( self , element , widget ) : #NEWLINE# #INDENT# 'Replace an existing element with the given widget.' #NEWLINE# DOM . getParent ( element ) . replaceChild ( widget . getElement ( ) , element ) #NEWLINE# self . adopt ( self , None ) #NEWLINE# self . children . append ( widget )