"""
-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
self.connect('enter-notify-event', _handle_focus_event, True)
def new_pixmap(self, width, height): return gtk.gdk.Pixmap(self.window, width, height, -1)
+ def get_pixbuf(self):
+ width, height = self._pixmap.get_size()
+ pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8, width, height)
+ pixbuf.get_from_drawable(self._pixmap, self._pixmap.get_colormap(), 0, 0, 0, 0, width, height)
+ return pixbuf
##########################################################################
## Handlers
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),
)