From a374510cfcb5529a1471696cdf0e5131f157a5f7 Mon Sep 17 00:00:00 2001 From: einarr Date: Thu, 31 Aug 2006 15:35:55 +0000 Subject: [PATCH] Fixed a bug when dragging a plot into the active ViewFrame. --- system/plots.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system/plots.py b/system/plots.py index 8a176bc..606faa8 100644 --- a/system/plots.py +++ b/system/plots.py @@ -84,6 +84,7 @@ class ViewFrame (gtk.Frame): def focus(self): """Gets focus and ensures that no other window is in focus.""" if self.focused: + self.emit('focus-changed', self, True) return self for frame in self.view_frames: @@ -123,7 +124,8 @@ class ViewFrame (gtk.Frame): if self._button_event: self._view.disconnect(self._button_event) - self._button_event = view.connect("button-press-event", self.on_button_press_event) + self._button_event = view.connect("button-press-event", + self.on_button_press_event) # remove old view, set new view self._view.hide() @@ -143,7 +145,8 @@ class ViewFrame (gtk.Frame): if not self.focused: self.focus() - def on_drag_data_received(self, widget, drag_context, x, y, selection, info, timestamp): + def on_drag_data_received(self, widget, drag_context, x, y, + selection, info, timestamp): treestore, path = selection.tree_get_row_drag_data() iter = treestore.get_iter(path) obj = treestore.get_value(iter,2) @@ -294,6 +297,7 @@ class EmptyView (Plot): class NavToolbar(NavigationToolbar2): toolitems = (('Select', 'Select within rectangle', 'zoom_to_rect.png', 'select'),) + NavigationToolbar2.toolitems + def __init__(self, *args): NavigationToolbar2.__init__(self, *args) self._select_callback = None