@@ -103,10 +103,17 @@ def set_value(self, value=None):
103
103
"""
104
104
Set the value of the param. If a setter is registered, it will be called.
105
105
106
- If the setter returns a value, it will become the new value of this param.
106
+ If the setter returns a value, this will become the new value of this param.
107
+
108
+ If the setter doesn't return a value, the getter will be called if present,
109
+ and the value it returns will become the new value of this param.
110
+
111
+ If the setter doesn't return a value, and there is no getter, the value
112
+ provided as an argument will become the new value of this param
107
113
108
114
:param value: The value this param should be set to (if None, we grab the value from
109
115
the param's input box.)
116
+ :returns: The new value of the param.
110
117
"""
111
118
# If a value is not provided, grab one from the input
112
119
if value is None :
@@ -128,13 +135,15 @@ def set_value(self, value=None):
128
135
new_value = value
129
136
# Update the value stored to the new value
130
137
self ._value = new_value
131
- # Update the input as well, clearing the highlight
138
+ # Update the input as well
132
139
self ._input_set_value (new_value )
133
140
else :
134
141
self ._value = value
135
142
143
+ # Clear the highlight and emit the changed signal
136
144
self .input .setStyleSheet ("" )
137
145
self .changed .emit ()
146
+ return self ._value
138
147
139
148
def get_value (self ):
140
149
"""
0 commit comments