Public Member Functions | |
ShapedWindow (int W, int H, const char *l=0) | |
ShapedWindow (int X, int Y, int W, int H, const char *l=0) | |
void | shape (xbmImage *b) |
void | shape (xbmImage &b) |
Protected Member Functions | |
virtual void | draw () |
Protected Attributes | |
xbmImage * | shape_ |
int | lw |
int | lh |
int | changed |
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 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".
|
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 shape(). |