summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2014-12-09 11:38:12 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2014-12-09 11:38:12 -0800
commite6193c24f5dd9c614de823c6839ca49e48ca4b2b (patch)
tree4f5e12e5a062e9f1219567a808a2ef6bc8b90cea
parent5f641c0c7157d9e22136d7bdfb21465386e6aa81 (diff)
parent236acdf758ef5defa4370ea66e2113bed0d91716 (diff)
Merge remote-tracking branch 'gnuradio-wg-grc/maint_grcwg' into maint
-rw-r--r--grc/gui/Param.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/grc/gui/Param.py b/grc/gui/Param.py
index 499af2e2ed..ef1c154933 100644
--- a/grc/gui/Param.py
+++ b/grc/gui/Param.py
@@ -99,7 +99,11 @@ class EntryParam(InputParam):
def set_color(self, color):
self._input.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
self._input.modify_text(gtk.STATE_NORMAL, Colors.PARAM_ENTRY_TEXT_COLOR)
- def set_tooltip_text(self, text): self._input.set_tooltip_text(text)
+ def set_tooltip_text(self, text):
+ try:
+ self._input.set_tooltip_text(text)
+ except AttributeError:
+ pass # no tooltips for old GTK
class EnumParam(InputParam):
"""Provide an entry box for Enum types with a drop down menu."""
@@ -112,7 +116,11 @@ class EnumParam(InputParam):
self._input.connect('changed', self._apply_change)
self.pack_start(self._input, False)
def get_text(self): return self.param.get_option_keys()[self._input.get_active()]
- def set_tooltip_text(self, text): self._input.set_tooltip_text(text)
+ def set_tooltip_text(self, text):
+ try:
+ self._input.set_tooltip_text(text)
+ except AttributeError:
+ pass # no tooltips for old GTK
class EnumEntryParam(InputParam):
"""Provide an entry box and drop down menu for Raw Enum types."""
@@ -133,9 +141,13 @@ class EnumEntryParam(InputParam):
if self._input.get_active() == -1: return self._input.get_child().get_text()
return self.param.get_option_keys()[self._input.get_active()]
def set_tooltip_text(self, text):
- if self._input.get_active() == -1: #custom entry
- self._input.get_child().set_tooltip_text(text)
- else: self._input.set_tooltip_text(text)
+ try:
+ if self._input.get_active() == -1: #custom entry
+ self._input.get_child().set_tooltip_text(text)
+ else:
+ self._input.set_tooltip_text(text)
+ except AttributeError:
+ pass # no tooltips for old GTK
def set_color(self, color):
if self._input.get_active() == -1: #custom entry, use color
self._input.get_child().modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))