From 83aa722103df1b5dd4d95b0785a0ae9b63b406b9 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 1 Oct 2017 12:21:23 +0200 Subject: [PATCH] frontends (xmlui): a dict of named widgets is kept, so they can be easily be retrieved --- frontends/src/tools/xmlui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontends/src/tools/xmlui.py b/frontends/src/tools/xmlui.py index c8dffcdd..15bbb95e 100644 --- a/frontends/src/tools/xmlui.py +++ b/frontends/src/tools/xmlui.py @@ -324,7 +324,8 @@ class XMLUIPanel(XMLUIBase): def __init__(self, host, parsed_dom, title=None, flags=None, callback=None, profile=C.PROF_KEY_NONE): super(XMLUIPanel, self).__init__(host, parsed_dom, title=title, flags=flags, callback=callback, profile=profile) - self.ctrl_list = {} # usefull to access ctrl + self.ctrl_list = {} # input widget, used mainly for forms + self.widgets = {} # allow to access any named widgets self._main_cont = None self.constructUI(parsed_dom) @@ -480,6 +481,9 @@ class XMLUIPanel(XMLUIBase): log.error(_("FIXME FIXME FIXME: widget type [%s] is not implemented") % type_) raise NotImplementedError(_("FIXME FIXME FIXME: type [%s] is not implemented") % type_) + if name: + self.widgets[name] = ctrl + if self.type == 'param' and type_ not in ('text', 'button'): try: ctrl._xmluiOnChange(self.onParamChange)