diff cagou/core/xmlui.py @ 235:525527a01439

xmlui: use create with partial and class_map, following change in base class
author Goffi <goffi@goffi.org>
date Fri, 31 Aug 2018 16:58:10 +0200
parents add3dcd65dd6
children ca86954b3788
line wrap: on
line diff
--- a/cagou/core/xmlui.py	Fri Aug 31 16:56:38 2018 +0200
+++ b/cagou/core/xmlui.py	Fri Aug 31 16:58:10 2018 +0200
@@ -35,6 +35,7 @@
 from kivy import properties
 from cagou import G
 from cagou.core import dialog
+from functools import partial
 
 
 ## Widgets ##
@@ -577,6 +578,6 @@
     dialog_factory = WidgetFactory()
 
 
-xmlui.registerClass(xmlui.CLASS_PANEL, XMLUIPanel)
-xmlui.registerClass(xmlui.CLASS_DIALOG, XMLUIDialog)
-create = xmlui.create
+create = partial(xmlui.create, class_map={
+    xmlui.CLASS_PANEL: XMLUIPanel,
+    xmlui.CLASS_DIALOG: XMLUIDialog})