I am trying to write a tool that displays additional information about the pixel being viewed by the pixel inspector. So I made a custom minor mode, and tried binding it to the "pointer-1--shift--drag" event, like this:
import rv
class MyInspectorMode(rv.rvtypes.MinorMode):
def __init__(self):
rv.rvtypes.MinorMode.__init__(self)
name = 'overridetest'
global_bindings = None
override_bindings = [
('pointer-1--shift--drag', self.printMsg, 'Print pointer loc')
]
self.init(name, global_bindings, override_bindings)
def printMsg(self, event):
print 'Pointer loc:', event.pointer()
event.reject()
def createMode():
return MyInspectorMode()
While my widget works, it unfortunately also causes the pixel inspector to stop behaving correctly. Basically, I can shift-click and the pixel inspector will appear, but when I shift-drag the pixel inspector no longer moves around with the mouse.
I tried following the recommendations in this section of the documentation:
http://www.tweaksoftware.com/static/documentation/rv/current/html/rv_reference.html#toc-Section-9.5
But even then, it still doesn't seem like the event is being passed properly along to the inspector. Does anyone know what I might be doing wrong? I've attached this code as a test package just in case anyone needs to take a closer look.
Thanks,
James
overrideTest_0.1.rvpkg