|void||shape (xbmImage *b)|
|virtual void||draw ()|
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 an fltk::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".
Fltk calls this virtual function to draw the widget, after setting up the graphics (current window, xy translation, etc) so that any drawing functions will go into this widget.
User code should not call this! You probably want to call redraw().
The default version calls draw_box() and draw_label(), thus drawing the box() to fill the widget and putting the label() and image() inside it to fill it, unless the align() flags are set to put it outside.
Information on how to write your own version is here.
Reimplemented from fltk::Window.
|void ShapedWindow::shape||(||xbmImage *||b||)||
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.