# HG changeset patch # User Goffi # Date 1506853283 -7200 # Node ID c7a7e650ac2f0a9fc4d296acaf34f6498b381798 # Parent 318f0434d8301a73a0af6debc13852c917842014 frontends (xmlui): a dict of named widgets is kept, so they can be easily be retrieved diff -r 318f0434d830 -r c7a7e650ac2f frontends/src/tools/xmlui.py --- a/frontends/src/tools/xmlui.py Sun Oct 01 12:21:23 2017 +0200 +++ b/frontends/src/tools/xmlui.py Sun Oct 01 12:21:23 2017 +0200 @@ -324,7 +324,8 @@ 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 @@ 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)