summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2014-03-14 11:18:55 +0100
committerSebastian Koslowski <koslowski@kit.edu>2014-03-14 11:18:55 +0100
commit56b13077335a814f3a72c8c759209bcc484ec712 (patch)
tree635b2c8c145746a50e62561726a92977f3982c38
parent69dcaa75b629af4ebc465a073f54af84b7c75a11 (diff)
grc: fix some PyGTK backwards compatibilty issues
-rw-r--r--grc/gui/ActionHandler.py12
-rw-r--r--grc/gui/DrawingArea.py10
2 files changed, 14 insertions, 8 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 86f06aad58..0d8998753d 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -359,11 +359,17 @@ class ActionHandler:
Dialogs.ErrorsDialog(self.get_flow_graph())
elif action == Actions.TOGGLE_REPORTS_WINDOW:
visible = action.get_active()
- self.main_window.reports_scrolled_window.set_visible(visible)
+ if visible:
+ self.main_window.reports_scrolled_window.show()
+ else:
+ self.main_window.reports_scrolled_window.hide()
Preferences.reports_window_visibility(visible)
elif action == Actions.TOGGLE_BLOCKS_WINDOW:
visible = action.get_active()
- self.main_window.btwin.set_visible(visible)
+ if visible:
+ self.main_window.btwin.show()
+ else:
+ self.main_window.btwin.hide()
Preferences.blocks_window_visibility(visible)
##################################################
# Param Modifications
@@ -472,7 +478,7 @@ class ActionHandler:
elif action == Actions.FIND_BLOCKS:
self.main_window.btwin.show()
self.main_window.btwin.search_entry.show()
- self.main_window.set_focus(self.main_window.btwin.search_entry)
+ self.main_window.btwin.search_entry.grab_focus()
elif action == Actions.OPEN_HIER:
bn = [];
for b in self.get_flow_graph().get_selected_blocks():
diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py
index 9fac791284..05e69e7bc6 100644
--- a/grc/gui/DrawingArea.py
+++ b/grc/gui/DrawingArea.py
@@ -63,7 +63,7 @@ class DrawingArea(gtk.DrawingArea):
def _handle_notify_event(widget, event, focus_flag): self._focus_flag = focus_flag
self.connect('leave-notify-event', _handle_notify_event, False)
self.connect('enter-notify-event', _handle_notify_event, True)
- self.set_can_focus(True)
+ self.set_flags(gtk.CAN_FOCUS) # self.set_can_focus(True)
self.connect('focus-out-event', self._handle_focus_lost_event)
def new_pixmap(self, width, height): return gtk.gdk.Pixmap(self.window, width, height, -1)
@@ -140,7 +140,7 @@ class DrawingArea(gtk.DrawingArea):
def _handle_focus_lost_event(self, widget, event):
# don't clear selection while context menu is active
- if self._flow_graph.get_context_menu().get_visible(): return
- self._flow_graph.unselect()
- self._flow_graph.update_selected()
- self._flow_graph.queue_draw()
+ if not self._flow_graph.get_context_menu().flags() & gtk.VISIBLE:
+ self._flow_graph.unselect()
+ self._flow_graph.update_selected()
+ self._flow_graph.queue_draw()