Tk::Icon - Change Icon of Tk-Windows under Win32
use Tk; use Tk::Icon; my $mw = MainWindow->new; $mw->setIcon(-file => 'usa.ico'); MainLoop;
Tk::Icon imports the setIcon-function into the Tk::Toplevel-Package and provides to change the Icon of a Toplevel-window under Win32.
At the moment, there is no possibility to manipulate the Icon using configure/cget or to destroy it. See TODO.
I've tested it under Windos 98SE and Windows 2000 using Perl 5.6.0 and Tk 800.022 only, but it should work under all Win32-compatible operating systems because it uses documented Win32-API-Calls.
At the moment, there is only one method supplied:
Specififes the Icon to display in the window's title bar. The ICO-File must supply an 16x16-Image that will be displayed in the upper left corner of the window. You can additionally supply an 32x32-Image that will be displayed in the so-called Task-Switcher (that one that comes up when you press Alt-Tab).
When you later in the program call this method again, the previous icon will be destroyed and the new one will be loaded.
Rewrite Module to support configure/cget (therefore rewrite as common Tk-Module).
Function to destroy the Icon (so that the Standard Tk-Icon will be displayed).
First public release.
Martin Schmuker, martin@schmuker.de