Restoring dock icon
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