home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
PROGRAM
/
AECUR100.ZIP
/
CONTRIB
/
CURSES
/
SRC
/
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);
}