[Pythonmac-SIG] Using NSViewAnimation
Dinu Gherman
gherman at darwin.in-berlin.de
Sun Jul 13 00:47:18 CEST 2008
Hi,
I'm trying for the first time to use NSViewAnimation in
an NSView.mouseDown_() method like in this code below:
def mouseDown_(self, event):
"Animate frame expansion."
viewFrame = self.frame()
newFrame = (
(viewFrame[0][0]-5, viewFrame[0][1]-5),
(viewFrame[1][0]+10, viewFrame[1][1]+10)
)
viewDict = {
NSViewAnimationTargetKey: self,
NSViewAnimationStartFrameKey: viewFrame,
NSViewAnimationEndFrameKey: newFrame,
}
anim =
NSViewAnimation.alloc().initWithViewAnimations_([viewDict])
anim.setDuration_(1.0)
anim.setAnimationCurve_(NSAnimationEaseIn)
anim.startAnimation()
# anim.release()
But when klicking an item I get an exception like this:
Traceback (most recent call last):
File "simpleedit0.py", line 225, in <module>
main()
File "simpleedit0.py", line 221, in main
AppHelper.runEventLoop()
File "/usr/local/lib/python2.5/site-packages/PyObjC/PyObjCTools/
AppHelper.py", line 237, in runEventLoop
NSApp().run()
ValueError: NSInvalidArgumentException - Class OC_PythonObject: no
such selector: rectValue
Has anybody else used NSViewAnimation successfully? Or could
a reason for this be the fact that I'm using a single Python
script without any Xcode or NIB files?
Thanks,
Dinu
More information about the Pythonmac-SIG
mailing list