summaryrefslogtreecommitdiff
path: root/grc/gui
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui')
-rw-r--r--grc/gui/Param.py14
-rw-r--r--grc/gui/PropsDialog.py2
2 files changed, 10 insertions, 6 deletions
diff --git a/grc/gui/Param.py b/grc/gui/Param.py
index b84598e61..7fabb6671 100644
--- a/grc/gui/Param.py
+++ b/grc/gui/Param.py
@@ -30,7 +30,7 @@ class InputParam(gtk.HBox):
gtk.HBox.__init__(self)
self.param = param
self._callback = callback
- self.label = gtk.Label('') #no label, markup is added by set_markup
+ self.label = gtk.Label() #no label, markup is added by set_markup
self.label.set_size_request(150, -1)
self.pack_start(self.label, False)
self.set_markup = lambda m: self.label.set_markup(m)
@@ -66,7 +66,11 @@ class InputParam(gtk.HBox):
self.param.set_value(self.get_text())
#call the callback
if self._callback: self._callback()
- #self.update() #dont update here, parent will update
+ else:
+ #no callback mode (used in supporting gui scripts)
+ #internally re-validate the param and update the gui
+ self.param.validate()
+ self.update()
class EntryParam(InputParam):
"""Provide an entry box for strings and numbers."""
@@ -155,9 +159,9 @@ class Param(Element):
All others get a standard entry parameter.
@return gtk input class
"""
- if self.is_enum(): return EnumParam(*args, **kwargs)
- if self.get_options(): return EnumEntryParam(*args, **kwargs)
- return EntryParam(*args, **kwargs)
+ if self.is_enum(): return EnumParam(self, *args, **kwargs)
+ if self.get_options(): return EnumEntryParam(self, *args, **kwargs)
+ return EntryParam(self, *args, **kwargs)
def get_layout(self):
"""
diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index aa86f7214..34fd7ec17 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -123,7 +123,7 @@ class PropsDialog(gtk.Dialog):
io_param.destroy()
#repopulate the params box
for param in self._block.get_params():
- io_param = param.get_input(param, callback=self._update)
+ io_param = param.get_input(self._update)
self._input_object_params.append(io_param)
self._params_box.pack_start(io_param, False)
#update the gui inputs