diff options
author | Josh Blum | 2010-03-09 12:40:43 -0800 |
---|---|---|
committer | Josh Blum | 2010-03-09 12:40:43 -0800 |
commit | d844c4f06dc10c8499eb2b8f1cb5b55f55a5b48d (patch) | |
tree | a179bce6d4465048861eac0117ed54ce0d29825b /grc/gui/DrawingArea.py | |
parent | eb6ff48d9b5894d1662f361d82d2c7cd80b35218 (diff) | |
download | gnuradio-d844c4f06dc10c8499eb2b8f1cb5b55f55a5b48d.tar.gz gnuradio-d844c4f06dc10c8499eb2b8f1cb5b55f55a5b48d.tar.bz2 gnuradio-d844c4f06dc10c8499eb2b8f1cb5b55f55a5b48d.zip |
added a right click context menu for the flow graph elements
Diffstat (limited to 'grc/gui/DrawingArea.py')
-rw-r--r-- | grc/gui/DrawingArea.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py index b70468ed0..790df7c3f 100644 --- a/grc/gui/DrawingArea.py +++ b/grc/gui/DrawingArea.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -82,19 +82,21 @@ class DrawingArea(gtk.DrawingArea): Forward button click information to the flow graph. """ self.ctrl_mask = event.state & gtk.gdk.CONTROL_MASK - self._flow_graph.handle_mouse_button_press( - left_click=(event.button == 1), + if event.button == 1: self._flow_graph.handle_mouse_selector_press( double_click=(event.type == gtk.gdk._2BUTTON_PRESS), coordinate=(event.x, event.y), ) + if event.button == 3: self._flow_graph.handle_mouse_context_press( + coordinate=(event.x, event.y), + event=event, + ) def _handle_mouse_button_release(self, widget, event): """ Forward button release information to the flow graph. """ self.ctrl_mask = event.state & gtk.gdk.CONTROL_MASK - self._flow_graph.handle_mouse_button_release( - left_click=(event.button == 1), + if event.button == 1: self._flow_graph.handle_mouse_selector_release( coordinate=(event.x, event.y), ) |