diff options
author | jblum | 2008-10-14 06:05:58 +0000 |
---|---|---|
committer | jblum | 2008-10-14 06:05:58 +0000 |
commit | 10ac1389a1d12524f1fdc0d7cf5eef6e31c12acb (patch) | |
tree | e0792d68afa16194697f1a6089256e8327b5a8ca /grc/src | |
parent | aeb0f46bd4b6ec474b3fddf0f8947f4fcde633aa (diff) | |
download | gnuradio-10ac1389a1d12524f1fdc0d7cf5eef6e31c12acb.tar.gz gnuradio-10ac1389a1d12524f1fdc0d7cf5eef6e31c12acb.tar.bz2 gnuradio-10ac1389a1d12524f1fdc0d7cf5eef6e31c12acb.zip |
str cast
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9794 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src')
-rw-r--r-- | grc/src/grc_gnuradio/wxgui/callback_controls.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/grc/src/grc_gnuradio/wxgui/callback_controls.py b/grc/src/grc_gnuradio/wxgui/callback_controls.py index 8027a580c..4c64cd12a 100644 --- a/grc/src/grc_gnuradio/wxgui/callback_controls.py +++ b/grc/src/grc_gnuradio/wxgui/callback_controls.py @@ -263,9 +263,8 @@ class text_box_control(_control_base): for obj in (label_text, text_box): #fill the container with label and text entry box label_text_sizer.Add(obj, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL) self.Add(label_text_sizer, 0, wx.ALIGN_CENTER) - #set the value, detect string mode + #detect string mode self._string_mode = isinstance(value, str) - self.text_box.SetValue(str(value)) def get_value(self): """ @@ -280,7 +279,8 @@ class text_box_control(_control_base): If the text cannot be evaluated, do not try callback. Do not evaluate the text box value in string mode. """ - if self._string_mode: self._value = self.text_box.GetValue() + if self._string_mode: + self._value = str(self.text_box.GetValue()) else: try: self._value = eval(self.text_box.GetValue()) except Exception, e: |