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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to