core (xmlui): container now keep a list of children
This commit is contained in:
parent
df038ad3d4
commit
3ec8f283cb
1 changed files with 2 additions and 0 deletions
|
|
@ -412,6 +412,7 @@ class Element(object):
|
||||||
@parent: parent element
|
@parent: parent element
|
||||||
"""
|
"""
|
||||||
assert self.type is not None
|
assert self.type is not None
|
||||||
|
self.children = []
|
||||||
if not hasattr(self, 'elem'):
|
if not hasattr(self, 'elem'):
|
||||||
self.elem = parent.xmlui.doc.createElement(self.type)
|
self.elem = parent.xmlui.doc.createElement(self.type)
|
||||||
self.xmlui = xmlui
|
self.xmlui = xmlui
|
||||||
|
|
@ -427,6 +428,7 @@ class Element(object):
|
||||||
"""
|
"""
|
||||||
self.elem.appendChild(child.elem)
|
self.elem.appendChild(child.elem)
|
||||||
child.parent = self
|
child.parent = self
|
||||||
|
self.children.append(child)
|
||||||
return child
|
return child
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue