8
votes

The icon in the OSX Dock is decided by the Info.plist entry CFBundleIconFile when the application is not running. The application can then alter this icon when running. The only icon that does not conform to this is the Calendar icon, which always shows the actual current day, even if the application is not running. How is this achieved? I checked the .app and the Info.plist and there's nothing pointing me toward the mechanism. Is Calendar handled magically by the Dock?

1

1 Answers

4
votes

AppKit allows you to create Dock Tile plug-ins by adopting the NSDockTilePlugIn protocol. Dock Tile plug-ins are packaged as bundle inside a main app. They are loaded into the SystemUIServer process and therefore can update the dock icon even if the main app is not running.
Details can be found in the Dock Tile Programming Guide.

Apple provides a simple Dock Tile sample here. Sadly that sample seems to be a bit flaky when running on newer OS X versions.