The following code should work, but doesnt:
from java.awt.event import MouseListener
from field.core.plugins.python import DynamicExtensionPoint
_self.onCanvas_ = DynamicExtensionPoint(MouseListener)
_self.enclosingFrame.getCanvas().addMouseListener(_self.onCanvas_.getProxy())
@_self.onCanvas_.mousePressed
def pressed(event):
print event
While this code does work
from java.awt.event import MouseListener
from field.core.plugins.python import DynamicExtensionPoint
_self.onCanvas_ = DynamicExtensionPoint(MouseListener)
_self.enclosingFrame.getCanvas().addMouseListener(_self.onCanvas_.getProxy())
m = _self.onCanvas_.mousePressed
@m
def pressed(event):
print event
It looks like _self.onCanvas_.mousePressed goes though the correct __findattr__ mechanism while _self.onCanvas_.mousePressed() somehow shorts it.