Commit 2e61be73 authored by Antony Lee's avatar Antony Lee
Browse files

Don't copy the context menu of ViewBoxes.

This allows customization of the context menu of a ViewBox simply by
calling  See issue #13.  Also some cleanup.
parent 1e821049
......@@ -1054,26 +1054,15 @@ class ViewBox(GraphicsWidget):
if ev.button() == QtCore.Qt.RightButton and self.menuEnabled():
def raiseContextMenu(self, ev):
#print "viewbox.raiseContextMenu called."
#menu = self.getMenu(ev)
menu = self.getMenu(ev)
self.scene().addParentContextMenus(self, menu, ev)
#print "2:", [str(a.text()) for a in]
pos = ev.screenPos()
#pos2 = ev.scenePos()
#print "3:", [str(a.text()) for a in]
menu.popup(QtCore.QPoint(pos.x(), pos.y()))
#print "4:", [str(a.text()) for a in]
def getMenu(self, ev):
self._menuCopy = ## temporary storage to prevent menu disappearing
return self._menuCopy
def getContextMenus(self, event):
if self.menuEnabled():
......@@ -275,4 +275,4 @@ class ViewBoxMenu(QtGui.QMenu):
from .ViewBox import ViewBox
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment