diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2014-11-07 11:30:44 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-11-07 11:30:44 +0100 |
commit | 236acdf758ef5defa4370ea66e2113bed0d91716 (patch) | |
tree | a58904ecc4dc848dcdfa833a6cf86d559679793a | |
parent | 8a8bfef084ed7a6ddc506f81690041d3b15a9540 (diff) |
grc: no tooltips for old GTK versions
-rw-r--r-- | grc/gui/Param.py | 22 |
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)) |