Re: I need a milder application badge (solution)
Re: I need a milder application badge (solution)
- Subject: Re: I need a milder application badge (solution)
- From: Rob Keniger <email@hidden>
- Date: Sun, 26 Jul 2009 13:24:57 +1000
On 26/07/2009, at 11:16 AM, Stuart Malin wrote:
Of course, you can have your custom view draw whatever you'd like
(in a 128 x 128 frame).
If the appearance of the view needs to change due to underlying
changes in teh state of your app, just issue the -display message to
the dockTile:
[NSApp dockTile] display];
and the contentView object's -drawRect will be called.
Stuart's technique is the correct one. You can easily draw the
application icon with a badge in the -drawRect: method of your custom
DockTile view:
- (void)drawRect:(NSRect)rect
{
NSRect bounds = [self bounds];
//draw the icon
NSImage* icon = [NSImage imageNamed:@"NSApplicationIcon"];
[icon setSize:bounds.size];
[icon drawAtPoint:NSZeroPoint fromRect:NSZeroRect
operation:NSCompositeCopy fraction:1.0];
//draw your badge
//badge drawing calls here
}
I do this myself in one of my apps and it works perfectly.
--
Rob Keniger
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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