• 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: Restoring dock icon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Restoring dock icon


  • Subject: Re: Restoring dock icon
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 31 Dec 2005 10:59:57 -0800
  • Thread-topic: Restoring dock icon

On Fri, 30 Dec 2005 16:24:11 +0100, Tomas Franz?n <email@hidden>
said:
>Hi,
>
>When my app quits, I'm restoring the dock icon to the regular app
>icon, like this:
>
> - (void)applicationWillTerminate:(NSNotification *)notification {
> [NSApp setApplicationIconImage:[NSImage imageNamed:@"AppIcon"]];
> }

There is no need for that. Just set it to nil.

I don't know, however, whether that's the cause of your problem. I can tell
you that setting it to nil works on my machine (i.e. even if I choose quit
from the dock menu, it works fine), so I would have to suggest that if that
doesn't solve it for you, the problem must be elsewhere in your code (i.e.
code that resets the dock image to the custom icon is being called somehow).
m.

>
>It works if I quit the app using the menubar (or cmd-Q). However, if
>I choose "Quit" from the dock menu, the regular app icon I set is
>briefly displayed, and then replaced with the previous icon. My guess
>is that Dock draws the previous (incorrect) icon (to replace the
>highlighted icon it shows when the menu is open) after I draw the new
>one. If I sleep for even 1/10 of a second before calling
>setApplicationIconImage, it works perfectly.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



_______________________________________________
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: Re: Detecting modifier keys when app launched from Dock
  • Next by Date: Re: Re: Agent Applications and launchd
  • Previous by thread: Restoring dock icon
  • Next by thread: Icons in Dock menu?
  • Index(es):
    • Date
    • Thread