]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test_addchstr.c
ncurses 5.9 - patch 20121124
[ncurses.git] / test / test_addchstr.c
index 6b4093e745b7369bd2d0bdbc151dc70e5d35e3ac..cc3dc4978cc172efb6ac22ac5a69bc866954a270 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_addchstr.c,v 1.15 2012/10/27 19:31:42 tom Exp $
+ * $Id: test_addchstr.c,v 1.16 2012/11/24 19:51:05 tom Exp $
  *
  * Demonstrate the waddchstr() and waddch functions.
  * Thomas Dickey - 2009/9/12
@@ -239,6 +239,15 @@ test_adds(int level)
        (void) cbreak();        /* take input chars one at a time, no wait for \n */
        (void) noecho();        /* don't echo input */
        keypad(stdscr, TRUE);
+
+       /*
+        * Show the characters added in color, to distinguish from those that
+        * are shifted.
+        */
+       if (has_colors()) {
+           start_color();
+           init_pair(1, COLOR_WHITE, COLOR_BLUE);
+       }
     }
 
     limit = LINES - 5;
@@ -272,13 +281,7 @@ test_adds(int level)
 
     doupdate();
 
-    /*
-     * Show the characters added in color, to distinguish from those that
-     * are shifted.
-     */
     if (has_colors()) {
-       start_color();
-       init_pair(1, COLOR_WHITE, COLOR_BLUE);
        show_attr = (attr_t) COLOR_PAIR(1);
        wbkgdset(work, show_attr | ' ');
     } else {