Tk::FreeDesktop::Wm - a bridge between Tk and freedesktop window managers
use Tk; use Tk::FreeDesktop::Wm; my $mw = MainWindow->new; my $fd = Tk::FreeDesktop::Wm->new(mw => $mw); # mw argument is optional my @supported_properties = $fd->supported; # empty if WM is not a freedesktop WM my($desktop_width, $desktop_height) = $fd->desktop_geometry; $fd->set_wm_icon(["/path/to/icon16.png", "/path/to/icon32.png", "/path/to/icon48.png"]);
Construct a Tk::FreeDesktop::Wm object. The named argument mw is optional and should be a Tk::MainWindow object, if given. If omitted, then the first MainWindow is used.
mw
Set or get the MainWindow object.
Set the window manager icon for the running application. The provided argument is either a single element or an array reference of images (for using icons in different sizes). Images may be specified as Tk::Photo objects, or as path names to the image files. By specifying PNG and JPEG files Tk::PNG resp. Tk::JPEG is automatically loaded.
Without this module, one could use the more restricted iconimage Tk::Wm method. It's restricted because images with transparency may not be displayed correctly, and there's no support for multiple icon sizes.
See also "BUGS" for restrictions with alpha channels.
It's not possible to get the alpha component of a pixel within Perl/Tk. The alpha information is transformed into simple transparency information, which may lead to suboptimal results. Currently it's better to stick to icon images with transparency information only (gif, xpm, png without alpha channel), or without transparency at all.
Currently there's a workaround which is enabled if Imager with PNG support is installed (i.e. if Imager::File::PNG can be loaded). In this case alpha channels are handled correctly.
Most methods are undocumented.
Many properties are yet unimplemented.
Slaven Rezic
http://www.freedesktop.org/wiki/Specifications/wm-spec/, Tk, Tk::Wm.
To install Tk::FreeDesktop::Wm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::FreeDesktop::Wm
CPAN shell
perl -MCPAN -e shell install Tk::FreeDesktop::Wm
For more information on module installation, please visit the detailed CPAN module installation guide.