home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
C
/
AECUR101
/
WCENTSTR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-08
|
587b
|
30 lines
/*----------------------------------------------------------------------
*
* wcentstr.c
*
* copyright (c) 1987,88,89,90 J. Alan Eldridge
*
* center a string on given row of a Curses window
*
*----------------------------------------------------------------------
*/
#include "curses.h"
int
wcentstr(win, row, str)
WINDOW *win;
int row;
char *str;
{
int skip;
skip = (win->maxx + 1 - strlen(str)) / 2;
wmove(win, row, 0);
wclrtoeol(win);
if (skip > 0)
wmove(win, row, skip);
return waddstr(win, str);
}