]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/newdemo.c
ncurses 5.7 - patch 20090829
[ncurses.git] / test / newdemo.c
index 21a8f64f0bd17acda1e8a34e66855c9968665530..8187982be2932d5b601bed9769ce3e546eacc465 100644 (file)
@@ -2,19 +2,17 @@
  *  newdemo.c  -       A demo program using PDCurses. The program illustrate
  *                     the use of colours for text output.
  *
  *  newdemo.c  -       A demo program using PDCurses. The program illustrate
  *                     the use of colours for text output.
  *
- * $Id: newdemo.c,v 1.27 2005/05/28 21:40:00 tom Exp $
+ * $Id: newdemo.c,v 1.32 2009/08/29 18:47:26 tom Exp $
  */
 
 #include <test.priv.h>
 
 #include <time.h>
 
  */
 
 #include <test.priv.h>
 
 #include <time.h>
 
-#define delay_output(x) napms(x)
-
 /*
  *  The Australian map
  */
 /*
  *  The Australian map
  */
-static const char *AusMap[16] =
+static CONST_MENUS char *AusMap[16] =
 {
     "           A           A ",
     "    N.T. AAAAA       AAAA ",
 {
     "           A           A ",
     "    N.T. AAAAA       AAAA ",
@@ -86,7 +84,7 @@ set_colors(WINDOW *win, int pair, int foreground, int background)
        if (pair > COLOR_PAIRS)
            pair = COLOR_PAIRS;
        init_pair(pair, foreground, background);
        if (pair > COLOR_PAIRS)
            pair = COLOR_PAIRS;
        init_pair(pair, foreground, background);
-       wattrset(win, COLOR_PAIR(pair));
+       (void) wattrset(win, COLOR_PAIR(pair));
     }
 }
 
     }
 }
 
@@ -98,7 +96,7 @@ use_colors(WINDOW *win, int pair, chtype attrs)
            pair = COLOR_PAIRS;
        attrs |= COLOR_PAIR(pair);
     }
            pair = COLOR_PAIRS;
        attrs |= COLOR_PAIR(pair);
     }
-    wattrset(win, attrs);
+    (void) wattrset(win, attrs);
     return attrs;
 }
 
     return attrs;
 }
 
@@ -225,12 +223,13 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 
     setlocale(LC_ALL, "");
 
 
     setlocale(LC_ALL, "");
 
+    CATCHALL(trap);
+
     initscr();
     if (has_colors())
        start_color();
     cbreak();
     curs_set(0);
     initscr();
     if (has_colors())
        start_color();
     cbreak();
     curs_set(0);
-    signal(SIGINT, trap);
     width = 48;
     height = 14;               /* Create a drawing window */
     win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2);
     width = 48;
     height = 14;               /* Create a drawing window */
     win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2);
@@ -320,6 +319,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
        j = 0;
        /*  Draw running As across in RED */
        set_colors(win, 7, COLOR_RED, COLOR_GREEN);
        j = 0;
        /*  Draw running As across in RED */
        set_colors(win, 7, COLOR_RED, COLOR_GREEN);
+       memset(save, ' ', sizeof(save));
        for (i = 2; i < width - 4; ++i) {
            k = mvwinch(win, 4, i);
            if (k == ERR)
        for (i = 2; i < width - 4; ++i) {
            k = mvwinch(win, 4, i);
            if (k == ERR)