• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to add number do Dock Icon like in Mail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add number do Dock Icon like in Mail?


  • Subject: Re: How to add number do Dock Icon like in Mail?
  • From: Jim Puls <email@hidden>
  • Date: Tue, 8 Apr 2008 13:26:02 -0700

On Apr 8, 2008, at 5:41 AM, email@hidden wrote:
On leopard or later, you can just do:

[[[NSApplication sharedApplication] dockTile] setBadgeLabel: [[NSNumber numberWithInt:42] stringValue]];

to put 42 as a badge

Matt

On 8 Apr 2008, at 14:06, Adam P Jenkins wrote:
See [NSApplication setApplicationIconImage: (NSImage*)]. This changes the application's icon, and updates its dock icon.

... but you should probably do some combination of these:

NSImage *customImage = [[NSWorkspace sharedWorkspace] iconForFile:[[NSBundle mainBundle] bundlePath]];
[customImage setSize:NSMakeSize(128.0,128.0)];
[NSApp setApplicationIconImage:customImage];
[[NSApp dockTile] setBadgeLabel:[[NSNumber numberWithInt:42] stringValue]];


since -[NSApplication applicationIconImage] isn't smart about icons pasted on in the Finder but -[NSWorkspace iconForFile:] is. Yes, I've filed a bug.

-> jp

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Re: How to add number do Dock Icon like in Mail? (From: Adam P Jenkins <email@hidden>)
 >Re: How to add number do Dock Icon like in Mail? (From: email@hidden)

  • Prev by Date: Re: Core Data with NSArrayController Confusion
  • Next by Date: Re: Binding NSTableColumn to NSArrayController programatically.
  • Previous by thread: Re: How to add number do Dock Icon like in Mail?
  • Next by thread: Re: How to add number do Dock Icon like in Mail?
  • Index(es):
    • Date
    • Thread