Re: Jumpy unsynchronized movement with NSViewAnimation
Re: Jumpy unsynchronized movement with NSViewAnimation
- Subject: Re: Jumpy unsynchronized movement with NSViewAnimation
- From: Shamyl Zakariya <email@hidden>
- Date: Thu, 31 May 2007 13:05:33 -0400
Wow, that looks pretty cool. Will you make the code available? :)
You bet. The app this is going into will be open source ;)
Are you subclassing NSAnimation? In my experience, that's really
what you have to do; delegate methods don't work very well for that
class. Which is a shame, because of the lack of inner classes in
Objective-C.
Well, considering the current version is the third implementation
I've attempted, I might as well go for a fourth! If I subclass
NSAnimation, I think the whole thing will get a bit simpler, and I
can be certain that updates are synchronized.
Also, how are you setting the positions of the labels? The best way
to do it would be to use the standard "sticks and springs"
autosizing stuff, instead of adjusting the positions yourself.
Well, one complexity of the labels is that if an existing warning is
refreshed, it slides to the top of the stack ( which is pretty neat
actually ) so the conventional spring layout approach doesn't work
here. Basically, I have a class called HelpBubbleMessageTween which
wraps the message class and handles position updates. If I take the
approach of subclassing NSAnimation, I can probably do away with the
MessageTween helper class.
email@hidden
"obviously, you're not a golfer"
-- the Dude
On May 31, 2007, at 11:12 AM, Jonathon Mah wrote:
Hi Shamyl,
On 2007-05-31, at 23:30, Shamyl Zakariya wrote:
I'm writing a "help bubble" for providing feedback for custom
NSFormatters I've written, since my formatters require fairly
strict input and I want meaningul feedback to the user to explain
what he'she entered wrong ). So when a user enters something the
formatter doesn't approve of, a little bubble appears beneath the
control with the error message from my formatter.
Wow, that looks pretty cool. Will you make the code available? :)
In the shrink-phase, you can see all the text drops about 1 pixel
as the bubble resizes, and then pops back to the correct position
at the end.
Are you subclassing NSAnimation? In my experience, that's really
what you have to do; delegate methods don't work very well for that
class. Which is a shame, because of the lack of inner classes in
Objective-C.
Also, how are you setting the positions of the labels? The best way
to do it would be to use the standard "sticks and springs"
autosizing stuff, instead of adjusting the positions yourself.
I'd be happy to take a look at the code if you'd like.
Jonathon Mah
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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