]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/ins_wide.c
ncurses 5.9 - patch 20121208
[ncurses.git] / test / ins_wide.c
index 38ffd7637d00b27041110d85096ddb09abacfe3c..6e4e7275cdf6723f75db63e865f32a86640c19a8 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: ins_wide.c,v 1.17 2012/06/09 20:29:33 tom Exp $
+ * $Id: ins_wide.c,v 1.19 2012/12/09 01:13:56 tom Exp $
  *
  * Demonstrate the wins_wstr() and wins_wch functions.
  * Thomas Dickey - 2002/11/23
@@ -242,6 +242,15 @@ test_inserts(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 inserted in color, to distinguish from those
+        * that are shifted.
+        */
+       if (has_colors()) {
+           start_color();
+           init_pair(1, COLOR_WHITE, COLOR_BLUE);
+       }
     }
 
     limit = LINES - 5;
@@ -275,13 +284,7 @@ test_inserts(int level)
 
     doupdate();
 
-    /*
-     * Show the characters inserted in color, to distinguish from those that
-     * are shifted.
-     */
     if (has_colors()) {
-       start_color();
-       init_pair(1, COLOR_WHITE, COLOR_BLUE);
        wbkgdset(work, (chtype) (COLOR_PAIR(1) | ' '));
     }
 
@@ -439,10 +442,10 @@ test_inserts(int level)
        }
     }
     if (level > 0) {
-       delwin(show);
        delwin(work);
        delwin(look);
     }
+    delwin(show);
 }
 
 static void