]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/testscanw.c
ncurses 4.2
[ncurses.git] / test / testscanw.c
1 /* gleaned from a web-search, shows a bug combining scanw and implicit scroll.
2  * Date:  1997/03/17
3  * From:  bayern@morpheus.cis.yale.edu
4  *
5  * $Id: testscanw.c,v 1.5 1997/09/20 14:16:20 tom Exp $
6  */
7 #include <test.priv.h>
8 #include <ctype.h>
9
10 int main(int argc, char *argv[])
11 {
12         long badanswer = 1;
13         long *response = &badanswer;
14
15         initscr();
16         scrollok(stdscr, TRUE);
17         idlok(stdscr, TRUE);
18         echo();
19
20 #if 0
21         trace(TRACE_UPDATE|TRACE_CALLS);
22 #endif
23         while (argc > 1) {
24                 if (isdigit(*argv[1]))
25                         move(atoi(argv[1]), 0);
26                 else if (!strcmp(argv[1], "-k"))
27                         keypad(stdscr, TRUE);
28                 argc--, argv++;
29         }
30
31         while (badanswer) {
32                 printw("Enter a number (0 to quit):\n");
33                 printw("--> ");
34                 scanw("%20ld", response);    /* yes, it's a pointer */
35         }
36         endwin();
37         return EXIT_SUCCESS;
38 }