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

Restoring dock icon


  • Subject: Restoring dock icon
  • From: Tomas Franzén <email@hidden>
  • Date: Fri, 30 Dec 2005 16:24:11 +0100

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"]];
}

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.

Is there a better solution than this hack?
Thanks,

Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/ _______________________________________________
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: [OT] A bit confused on pointers...
  • Next by Date: Re: [OT] A bit confused on pointers...
  • Previous by thread: autosize an nsimageview programmatically
  • Next by thread: Re: Restoring dock icon
  • Index(es):
    • Date
    • Thread