Re: animated button
Re: animated button
- Subject: Re: animated button
- From: Ricky Sharp <email@hidden>
- Date: Tue, 07 Feb 2006 13:51:16 -0600
On Monday, February 06, 2006, at 11:56PM, Andrew Thompson <email@hidden> wrote:
>Thanks. I guess what I was wondering more specifically is how to
>organize it: should I subclass NSButton, or make my own animated custom
>view class, or make a transparent button over a custom view? Or is
>there some other better way?
If you can require 10.4, definitely look into the new drawing hooks provided by NSButton/NSButtonCell. I haven't tried them myself, but supposedly they allow you to be able to override key methods to provide your own custom drawing. Continuing on, add a timer ivar to your subclass to drive what frame to display. Here, you should get all the benefits of being a button, yet have your appearance be animated.
Otherwise, I guess first try a transparent button over an animated view. The only problem I see with that is that you'd have two views ultimately represent your button. I don't know if there would be any drawbacks of having such a setup (can't think of any offhand).
I'd then say as a last choice to subclass NSButton/NSButtonCell (or even NSControl/NSActionCell). Then, provide all the necessary method implementations. Here, it may be worthwhile experimenting with just a subclass of NSButtonCell. It may be the case where it would work a-ok living inside a standard NSButton.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden