def add_child(self, child):
self.children.append(child)<EOL>child.parent = self<EOL>if self.view and self.view.is_loaded:<EOL><INDENT>self.view.dispatch({<EOL>'<STR_LIT:name>': '<STR_LIT>',<EOL>'<STR_LIT:html>': child.compile(),<EOL>'<STR_LIT>': '<STR_LIT:#>' + str(self.id)<EOL>})<EOL><DEDENT>
Add a new child element to this widget.

:param child: Object inheriting :class:`BaseElement`.