FLTK::ShapedWindow - Custom shaped window
This window's shape is clipped to an area defined by the alpha from an Image object. Current implementation insists that this be an FLTK::xbmImage, which limits you to 1-bit alpha which must be supplied by the program. It should not be hard to modify this on newer systems to accept an arbitrary Image.
The layout and widgets inside are unaware of the mask shape, and most will act as though the bounding box is available to them. Therefore this window type is usally sublassed or occupied by a single widget.
If the window will be short-lived and does not have to move, you may be much better off using a MenuWindow. This is a normal window but with no border and no pixels are changed unless you draw into them. Thus you can get arbitrary shapes by the simple expediency of not drawing where it should be "transparent".
my $self = $shapedwindow->new( $x, $y, $w, $h, $label );
Creates a new FLTK::ShapedWindow widget.
$shapedwindow->shape( $img );
The alpha channel of the supplied image is used as the shape of the window.
A pointer to the image is stored,
so it must remain in existence until
shape( ) is called again or the ShapedWindow is destroyed.
If you want your window to resize you should subclass and make a
layout( ) method that draws a new image and calls
Sanko Robinson <firstname.lastname@example.org> - http://sankorobinson.com/
Copyright (C) 2008-2010 by Sanko Robinson <email@example.com>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.