• 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: Dynamically changing an application's icon / Adding a badge
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamically changing an application's icon / Adding a badge


  • Subject: Re: Dynamically changing an application's icon / Adding a badge
  • From: Gregory Weston <email@hidden>
  • Date: Sun, 23 Oct 2005 08:42:46 -0400

Chad Armstrong wrote:

Is it possible to add a badge onto my application (a la Mail,
OmniWeb, Transmit, iChat, etc.) without using Carbon?  I noticed this
function in Cocoa:

[NSApp setApplicationIconImage:myIcon];

However, I don't know if this will be able to layer on a new icon
onto the existing application icon, or if this just swaps out the
existing icon completely.  Carbon has some Dock Icon functions like
OverlayApplicationDockTileImage which probably would do what I want,
but I'd like to keep to Cocoa-only if at all possible.

If I point out that technically it's not possible given that some of Cocoa lies on top of Carbon anyway, would that help? Or if you really want to, just make a category on NSApplication that offers overlayApplicationIconWithImage: and restoreApplicationIconImage methods.


// Typed into browser. 10.3, 10.4 or (10.2+Safari).
- (void)overlayApplicationIconWithImage:(NSImage*)inImage
{
  CGImageRef theImageRef = WebConvertNSImageToCGImageRef(inImage);
  if(theImageRef) (void)OverlayApplicationDockTileImage(theImageRef);
}

- (void)restoreApplicationIconImage
{
  (void)RestoreApplicationDockTileImage();
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: setTextColor making an application crash without being called
  • Next by Date: Re: Name of current function/selector
  • Previous by thread: Re: Dynamically changing an application's icon / Adding a badge
  • Next by thread: setTextColor making an application crash without being called
  • Index(es):
    • Date
    • Thread