Re: Dynamically changing an application's icon / Adding a badge
Re: Dynamically changing an application's icon / Adding a badge
- Subject: Re: Dynamically changing an application's icon / Adding a badge
- From: Ryan Britton <email@hidden>
- Date: Sun, 23 Oct 2005 16:23:28 -0700
You should [[icon copy] autorelease] or [icon setName:nil] first,
otherwise you'll just be drawing onto the cached instance of NSImage
with that name and will not be able to set the icon back to the non-
badge state without restarting the app.
On Oct 23, 2005, at 3:47 PM, Todd Yandell wrote:
On Oct 22, 2005, at 11:03 PM, Chad Armstrong wrote:
Is it possible to add a badge onto my application (a la Mail,
OmniWeb, Transmit, iChat, etc.) without using Carbon?
Try something like this (untested):
NSImage *icon = [NSImage imageNamed:@"NSApplicationIcon"];
[icon lockFocus];
// Draw your badge image here
[badgeImage compositeToPoint:NSZeroPoint];
[icon unlockFocus];
[NSApp setApplicationIconImage:icon];
Bye,
Todd Yandell
_______________________________________________
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
_______________________________________________
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