comparison sat_frontends/primitivus/xmlui.py @ 2737:5c2ed8a5ae22

frontends (XMLUI): TabsContainer can now be the main container (Primitivus keep the old behaviour and always use VerticalContainer as main container)
author Goffi <goffi@goffi.org>
date Wed, 02 Jan 2019 18:32:16 +0100
parents 56f94936df1e
children 378188abe941
comparison
equal deleted inserted replaced
2736:df2bc2e704bc 2737:5c2ed8a5ae22
429 callback=callback, 429 callback=callback,
430 ignore=ignore, 430 ignore=ignore,
431 profile=profile, 431 profile=profile,
432 ) 432 )
433 PrimitivusWidget.__init__(self, self.main_cont, self.xmlui_title) 433 PrimitivusWidget.__init__(self, self.main_cont, self.xmlui_title)
434
435
436 def _parseChilds(self, _xmlui_parent, current_node, wanted=("container",), data=None):
437 # Small hack to always have a VerticalContainer as main container in Primitivus.
438 # this used to be the default behaviour for all frontends, but now
439 # TabsContainer can also be the main container.
440 if _xmlui_parent is self:
441 node = current_node.childNodes[0]
442 if node.nodeName == "container" and node.getAttribute("type") == "tabs":
443 _xmlui_parent = self.widget_factory.createVerticalContainer(self)
444 self.main_cont = _xmlui_parent
445 return super(XMLUIPanel, self)._parseChilds(_xmlui_parent, current_node, wanted,
446 data)
447
434 448
435 def constructUI(self, parsed_dom): 449 def constructUI(self, parsed_dom):
436 def postTreat(): 450 def postTreat():
437 assert self.main_cont.body 451 assert self.main_cont.body
438 452