NSTextField won't fade
NSTextField won't fade
- Subject: NSTextField won't fade
- From: "Jake Smith" <email@hidden>
- Date: Wed, 3 Sep 2008 07:24:19 -0400
I'm trying to have an NSTextField fade in and then out over several seconds.
I've tried sequential animations, linked animations, and finally the method
reproduced below. All produce the same result: the text in the NSTextField
appears immediately, remains visible for the duration of the animation, then
disappears without being animated or fading. In the code below, msgLabel is
an outlet to the NSTextField and myNumber is a string. Can someone point me
in the right direction? I've been reading Apple documentation and mailing
lists for at least 6 hours. Thanks. By the way, if someone thinks they can
help me, but loathes Python for some reason, let me know and I can translate
this into Objective-C.
self.msgLabel.setStringValue_(NSString.stringWithString_(myNumber))
animDict1 = {NSViewAnimationTargetKey: self.msgLabel,
NSViewAnimationEffectKey: NSViewAnimationFadeInEffect}
animDict2 = {NSViewAnimationTargetKey: self.msgLabel,
NSViewAnimationEffectKey: NSViewAnimationFadeOutEffect}
anim =
NSViewAnimation.alloc().initWithViewAnimations_(NSArray.arrayWithObjects_(animDict1,animDict2,nil))
anim.setDuration_(5.0)
anim.startAnimation()
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden