diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2014-02-26 14:56:32 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-02-26 14:56:36 +0100 |
commit | 5d7316cb093a4708bbfcb5d61829f6e468b1c9aa (patch) | |
tree | 9c37b8151066338cb695548823f1c9189b7a8799 /grc/python/Param.py | |
parent | 4c8665422db1efeea228e7d35cdf2d58b6172b03 (diff) |
grc: fix error message in console when using qtgui blocks
Diffstat (limited to 'grc/python/Param.py')
-rw-r--r-- | grc/python/Param.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/grc/python/Param.py b/grc/python/Param.py index e603d6cdbe..3daa37f637 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -377,11 +377,17 @@ class Param(_Param, _GUIParam): (False, False): 'self.top_layout.addWidget(%(widget)s)', }[bool(tab), bool(pos)])%{'tab': tab, 'index': index, 'widget': '%s', 'pos': pos} - def gui_hint(ws, w): - if 'layout' in w: ws = ws.replace('addWidget', 'addLayout') - return ws%w + # FIXME: Move replace(...) into the make template of the qtgui blocks and return a string here + class GuiHint(object): + def __init__(self, ws): + self._ws = ws - return lambda w: gui_hint(widget_str, w) + def __call__(self, w): + return (self._ws.replace('addWidget', 'addLayout') if 'layout' in w else self._ws) % w + + def __str__(self): + return self._ws + return GuiHint(widget_str) ######################### # Grid Position Type ######################### |