Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
For Cocoa, draw into an NSImage for each frame of your animation via NSTimer, then use NSApplication's setApplicationIconImage: method.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
sorry, i am still a bit of a n00b with objective-c/cocoa. the aaron hillegass book was too hard for me to understand. don't bother. i don't need to have animated icons.

Yes, you're going to want to learn the basics of Cocoa before you dive into animating the Dock icon, which, like I said, involves timers and drawing. Good luck :)
 

mduser63

macrumors 68040
Nov 9, 2004
3,042
31
Salt Lake City, UT
ummm..... yes.... in english please?

Seriously, what kainjow suggested was rather simple. If you were unable to understand it, then you're definitely going to need more experience with Cocoa. You probably ought to go back and be persistent with Hillegass's book. Once things click, Cocoa programming becomes a lot of fun.
 

tominated

macrumors 68000
Original poster
Jul 7, 2006
1,723
0
Queensland, Australia
Seriously, what kainjow suggested was rather simple. If you were unable to understand it, then you're definitely going to need more experience with Cocoa. You probably ought to go back and be persistent with Hillegass's book. Once things click, Cocoa programming becomes a lot of fun.

i will try to understand it, but the only other languages that i am proficient at are english and xhtml/css. is there anything i should read before trying to understand the book? BTW: i can sort of, (barely) understand objective-c
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Basically there is no one-line simple way to do this. It is up to you to update the icon at a reasonable frequency (too often and you'll consume a lot of resources, not often enough and it'll look bad).

You can either draw each frame in a graphics package, load all of the frames into your app as NSImages and set the dock icon to each in turn in a timer or load the base image into your app and draw on top of that using Quartz. The second method is probably better, but requires you to understand more about what you are doing.
 

tominated

macrumors 68000
Original poster
Jul 7, 2006
1,723
0
Queensland, Australia
Basically there is no one-line simple way to do this. It is up to you to update the icon at a reasonable frequency (too often and you'll consume a lot of resources, not often enough and it'll look bad).

You can either draw each frame in a graphics package, load all of the frames into your app as NSImages and set the dock icon to each in turn in a timer or load the base image into your app and draw on top of that using Quartz. The second method is probably better, but requires you to understand more about what you are doing.

what is this quartz thing anyway? i have wanted to know what the coregraphics, quartz, etc. are all about
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
what is this quartz thing anyway? i have wanted to know what the coregraphics, quartz, etc. are all about

Quartz is the Mac OSX native drawing layer based on PDF. It's exposed in Cocoa via NSBezierPath and the like or you can drop right down into CoreGraphics which is a lower level representation of Quartz.
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
Quartz is what the system uses to draw. That simple enough?

<edit>
Also, AIDockController (which handles the animated dock icons in Adium) is a horrendous mess, and rather large. Nothing I'd ever inflict on a beginner.
</edit>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.