changeset 2365:318f0434d830

core (xmlui): container now keep a list of children
author Goffi <goffi@goffi.org>
date Sun, 01 Oct 2017 12:21:23 +0200 (2017-10-01)
parents 918e38622a48
children c7a7e650ac2f
files src/tools/xml_tools.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/tools/xml_tools.py	Sun Oct 01 12:21:23 2017 +0200
+++ b/src/tools/xml_tools.py	Sun Oct 01 12:21:23 2017 +0200
@@ -412,6 +412,7 @@
         @parent: parent element
         """
         assert self.type is not None
+        self.children = []
         if not hasattr(self, 'elem'):
             self.elem = parent.xmlui.doc.createElement(self.type)
         self.xmlui = xmlui
@@ -427,6 +428,7 @@
         """
         self.elem.appendChild(child.elem)
         child.parent = self
+        self.children.append(child)
         return child