• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: animated button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: animated button


  • Subject: Re: animated button
  • From: Andrew Thompson <email@hidden>
  • Date: Mon, 6 Feb 2006 21:56:02 -0800


On Feb 6, 2006, at 1:57 PM, Ricky Sharp wrote:


On Feb 6, 2006, at 1:56 PM, Andrew Thompson wrote:

I would like to make a button with an animated background. Does anyone have advice on the best way to go about this?

NSTimer? When it fires you can basically do something like this:

[self incrementFrameIndex];
[self setNeedsDisplay:YES];

In your draw routine, draw the current frame.

Note that you can set up the timer to either suspend or continue to fire during tracking events. Not sure what your needs are in that respect.


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?


~Andrew

_______________________________________________
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


  • Follow-Ups:
    • Re: animated button
      • From: Ricky Sharp <email@hidden>
References: 
 >animated button (From: Andrew Thompson <email@hidden>)
 >Re: animated button (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Double Fun
  • Next by Date: How to change the strings in application menu
  • Previous by thread: Re: animated button
  • Next by thread: Re: animated button
  • Index(es):
    • Date
    • Thread