Fixed a bug when dragging a plot into the active ViewFrame.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user