Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to draw numbers into a dock icon badge



Hi all and happy new year!

I'm trying to draw a badge, as in mail.app, and then draw the numbers onto it.

Thanks to code snippets and advice from the list (thanks!) I've got the badge on there but can't seem to draw numbers onto it.
I'm pretty new at the cocoa thing really so apologies but I'd appreciate any help that's out there.


partial code snippet below.... it IS displaying the badget, but I'm obviously messing up the attributedstring drawing.

[appImage lockFocus];
[badge compositeToPoint:NSMakePoint(80, 80) operation:NSCompositeSourceOver];


//quick attempt to draw a 1 in the badge
[@"1" drawAtPoint:NSMakePoint(10,10) withAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:
   [NSColor whiteColor], NSForegroundColorAttributeName,
   [NSFont systemFontOfSize:2], NSFontAttributeName,
nil]];

[appImage unlockFocus];


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.