Programming Guide



sm_bkrect

Sets the background color of a rectangle

int sm_bkrect(int start_line, int start_col, int num_of_lines, int num_of_col, int bkgr_colors);

start_line, start_col
Specify the upper-left corner of the area to set, where the values of start_line and start_column can range from 0 through the length and width of the screen less 1, respectively.

num_of_lines
The length of the area to set.

num_of_col
The width of the area to set.

bkgr_colors
The attributes to set as the area's background color.

Environment

Character-mode

Returns

Description

sm_bkrect changes the background color of a rectangular area of the current screen. The background color must be one of the constants defined in smattrib.h. You can highlight the background color by OR'ing the background color attribute with B_HILIGHT.

All fields or elements that start inside the area have their background attributes changed to the specified attribute. Display text inside the rectangular area has its background attribute set. Make sure that fields or elements that change are entirely inside the area; otherwise, a ragged edge results.

Example

/*		Draw some colored squares on the display*/
int colors[] =
{
B_RED,
B_BLUE,
B_WHITE,
B_CYAN
};

int mondrian(void)
{
int i;
for (i=0;i<sizeof(colors)/sizeof(int);i++)
{
sm_bkrect((i/2) * 10,(i & 1) * 40, 10, 40, colors[i]);
}
return(0);
}