home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_10
/
9n10105a
< prev
next >
Wrap
Text File
|
1991-07-24
|
832b
|
48 lines
#define WIDTH 400
#define HEIGHT 300
#define MAX_RECTS 100
XRectangle rectangles[ MAX_RECTS + 1 ];
Display *display;
Window window;
int number_rectangles, i;
/*
* Set up some rectangles
*/
i = 0;
for ( x = 0; x < WIDTH; x += 50 )
{
for( y = 0; y < HEIGHT; y += 50 )
{
i++;
if ( i >= MAX_RECTS )
{
i = MAX_RECTS - 1;
}
rectangles[i].width = 45;
rectangles[i].height = 45;
rectangles[i].x = x;
rectangles[i].y = y;
}
}
/*
* Make our window's shape be the set of rectangles
*/
number_rectangles = i;
XShapeCombineRectangles( display,
window,
ShapeBounding,
0, 0, /* x, y, offsets */
rectangles,
number_rectangles,
ShapeSet,
Unsorted ); /* we haven't sorted the rects */