BSD

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Trying to draw numbers into a dock icon badge

    2 answers - 1398 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    This is just a guess, but I'm thinking that a font whose size is 2 would be
    very, very, very small.
    Greg
    1/1/06 5:34 PM, "Keith Pritchard" <keith (AT) theinter (DOT) netwrote:
    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:NSCompositeS];
    //quick attempt to draw a 1 in the badge
    [@"1" drawAtPoint:NSMakePoint(10,10) withAttributes:[NSDictionary
    dictionaryWAndKeys:
    [NSColor whiteColor], NSForegroundColorAttributeName,
    [NSFont systemFSize:2], NSFontAttributeName,
    nil]];
    [appImage unlockFocus];
    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com
    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.1 | | 1932 bytes | |

    Keep in mind that the Dock resizes the icon to fit. So pick a font
    size that will show normally on a 128x128 image (the size of the icon).
    -- August

    Jan 1, 2006, at 10:30 PM, Greg Herlihy wrote:

    This is just a guess, but I'm thinking that a font whose size is 2
    would be
    very, very, very small.

    Greg

    1/1/06 5:34 PM, "Keith Pritchard" <keith (AT) theinter (DOT) netwrote:
    >
    >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:NSCompositeS];
    >>

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

    >[appImage unlockFocus];


    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.2 | | 2256 bytes | |

    Hi Greg,

    Thanks for the suggestion but I'm pretty sure it's not a font size
    problem.

    I've tried a variety of sizes in random desperate attempts to get
    something, anything to show.

    Absolutely nothing appears in the badge, not even a single changed
    pixel it really does feel
    like nothing is being drawn at all in any way so I'm thinking there's
    a fundamental problem with
    my drawatpoint line

    Keith

    2 Jan 2006, at 03:30, Greg Herlihy wrote:

    This is just a guess, but I'm thinking that a font whose size is 2
    would be
    very, very, very small.

    Greg

    1/1/06 5:34 PM, "Keith Pritchard" <keith (AT) theinter (DOT) netwrote:
    >
    >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:NSCompositeS];
    >>

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

    >[appImage unlockFocus];
    >
    >


    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com

Re: Trying to draw numbers into a dock icon badge


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "BSD"

EMSDN.COM