I'm pleased to announce the release of Tkdock 1.0.
The tkdock package is a small, Cocoa-based Tcl extension that allows a Tcl/Tk application to change its icon on the OS X Dock while running. This can be useful for indicating changes in application state, for instance that the application is executing a long-running process, connecting to a server, or similar activities.
Using the Tkdock Package
Tkdock is invoked by calling package require tkdock. It implements two commands:
::tkdock::switchIcon /path/to/icon: This command switches the application's Dock icon while the application is running, and takes a path to an image as an argument. Any image format supported on Mac OS X should work, but Apple's native "icns" icon format (at 128x128 pixels) appears to provide the sharpest results.
::tkdock::origIcon: This command restores the original application icon.
Because it calls into the Mac's native Cocoa frameworks, tkdock is a binary extension (shipped as a .dylib). The universal binary package was built against Tcl/Tk 8.5.3 on Mac OS X 10.5.6 and should run on both Intel and PPC systems. The source code comes with a makefile if you want to build the extension yourself. Tkdock is available under the standard Tcl/Tk BSD-style license.