X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fnewdemo.c;h=04c52751c570814d90b4f96e635e66022c9e971c;hp=20b26d024e4ae32e38de030572ce86c4fda6cf78;hb=f8f67d02e909c4d165fbed2ba2810c94f2862548;hpb=12b49d3c56a6130feb2d39fbe2d6c1bc0838f0fa diff --git a/test/newdemo.c b/test/newdemo.c index 20b26d02..04c52751 100644 --- a/test/newdemo.c +++ b/test/newdemo.c @@ -2,7 +2,7 @@ * newdemo.c - A demo program using PDCurses. The program illustrate * the use of colours for text output. * - * $Id: newdemo.c,v 1.45 2017/09/30 15:43:08 tom Exp $ + * $Id: newdemo.c,v 1.46 2019/08/24 23:02:49 tom Exp $ */ #include @@ -61,11 +61,12 @@ static int WaitForUser(WINDOW *win) { time_t t; - chtype key; nodelay(win, TRUE); t = time((time_t *) 0); + while (1) { + chtype key; if ((int) (key = (chtype) wgetch(win)) != ERR) { if (key == 'q' || key == 'Q') return 1; @@ -221,12 +222,10 @@ int main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { WINDOW *win; - int w, x, y, i, j, k; + int x, y, i, k; char buffer[SIZEOF(messages) * 80]; - const char *message; int width, height; chtype save[80]; - chtype c; setlocale(LC_ALL, ""); @@ -244,6 +243,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) } while (1) { + int w; + int j; + chtype c; + const char *message; + set_colors(win, 1, COLOR_WHITE, COLOR_BLUE); werase(win);