comparison src/tools/xml_tools.py @ 1490:55cff13b1f10

core (xmlui): reverted change from 039d96e131be: we should be able to recreate the same container with changeContainer
author Goffi <goffi@goffi.org>
date Tue, 25 Aug 2015 15:39:16 +0200
parents 0df627d0b4ca
children adc72c39f032
comparison
equal deleted inserted replaced
1489:039d96e131be 1490:55cff13b1f10
363 parent.append(self) 363 parent.append(self)
364 self.parent = parent 364 self.parent = parent
365 365
366 def append(self, child): 366 def append(self, child):
367 """Append a child to this element. 367 """Append a child to this element.
368 368
369 @param child (Element): child element 369 @param child (Element): child element
370 @return: the added child Element 370 @return: the added child Element
371 """ 371 """
372 self.elem.appendChild(child.elem) 372 self.elem.appendChild(child.elem)
373 child.parent = self 373 child.parent = self
569 """Add a tab. 569 """Add a tab.
570 570
571 @param name (unicode): tab name 571 @param name (unicode): tab name
572 @param label (unicode): tab label 572 @param label (unicode): tab label
573 @param selected (bool): set to True to select this tab 573 @param selected (bool): set to True to select this tab
574 @param container (class): container class, inheriting from Container 574 @param container (class): container class, inheriting from Container
575 @return: the container for the new tab 575 @return: the container for the new tab
576 """ 576 """
577 if not label: 577 if not label:
578 label = name 578 label = name
579 tab_elt = TabElement(self, name, label, selected) 579 tab_elt = TabElement(self, name, label, selected)
1170 """Change the current container 1170 """Change the current container
1171 1171
1172 @param container: either container type (container it then created), 1172 @param container: either container type (container it then created),
1173 or an Container instance""" 1173 or an Container instance"""
1174 if isinstance(container, basestring): 1174 if isinstance(container, basestring):
1175 if not isinstance(self.current_container, self._containers[container]): 1175 self.current_container = self._createContainer(container, self.current_container.getParentContainer() or self.main_container, **kwargs)
1176 self.current_container = self._createContainer(container, self.current_container.getParentContainer() or self.main_container, **kwargs)
1177 else: 1176 else:
1178 self.current_container = self.main_container if container is None else container 1177 self.current_container = self.main_container if container is None else container
1179 assert isinstance(self.current_container, Container) 1178 assert isinstance(self.current_container, Container)
1180 return self.current_container 1179 return self.current_container
1181 1180