]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test_getstr.c
ncurses 6.0 - patch 20170715
[ncurses.git] / test / test_getstr.c
index 4c243092b75460ec9c2d63ba4e12d060548752c8..bb1c12656fcbbebda53fa0a5e840337d076bd23c 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_getstr.c,v 1.11 2017/04/15 14:14:37 tom Exp $
+ * $Id: test_getstr.c,v 1.12 2017/07/01 20:34:55 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -43,6 +43,7 @@
  */
 
 #include <test.priv.h>
+#include <popup_msg.h>
 
 #if HAVE_CHGAT
 /* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */
@@ -143,6 +144,28 @@ ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit)
 static int
 recursive_test(int level, char **argv, WINDOW *strwin)
 {
+    static const char *help[] =
+    {
+       "Commands:",
+       "  q,^Q,ESC       - quit this program",
+       "  ^Q,ESC         - quit help-screen",
+       "",
+       "  p,<Up>         - move beginning of prompt one up row",
+       "  j,<Down>       - move beginning of prompt one down row",
+       "  h,<Left>       - move beginning of prompt one left column",
+       "  l,<Right>      - move beginning of prompt one right column",
+       "",
+       "  -              - reduce getnstr buffer-size one column",
+       "  +              - increase getnstr buffer-size one column",
+       "  :              - prompt for input-text",
+       "",
+       "  <              - scroll \"left\" through getstr-functions",
+       "  >              - scroll \"right\" through getstr-functions",
+       "",
+       "  w              - recur to subwindow",
+       "  ?,<F1>         - show help-screen",
+       0
+    };
     WINDOW *txtbox = 0;
     WINDOW *txtwin = 0;
     FILE *fp;
@@ -322,6 +345,9 @@ recursive_test(int level, char **argv, WINDOW *strwin)
            wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
            wnoutrefresh(strwin);
            break;
+       case HELP_KEY_1:
+           popup_msg(stdscr, help);
+           break;
        default:
            beep();
            break;