1999-08-24 01:06:48 +00:00
|
|
|
/* gleaned from a web-search, shows a bug combining scanw and implicit scroll.
|
|
|
|
* Date: 1997/03/17
|
|
|
|
* From: bayern@morpheus.cis.yale.edu
|
|
|
|
*
|
2002-05-21 05:30:25 +00:00
|
|
|
* $Id: testscanw.c,v 1.8 2001/09/15 21:41:45 tom Exp $
|
1999-08-24 01:06:48 +00:00
|
|
|
*/
|
|
|
|
#include <test.priv.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
2001-05-17 08:21:06 +00:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
1999-08-24 01:06:48 +00:00
|
|
|
{
|
2001-05-17 08:21:06 +00:00
|
|
|
long badanswer = 1;
|
|
|
|
long *response = &badanswer;
|
1999-08-24 01:06:48 +00:00
|
|
|
|
2001-05-17 08:21:06 +00:00
|
|
|
initscr();
|
|
|
|
scrollok(stdscr, TRUE);
|
|
|
|
idlok(stdscr, TRUE);
|
|
|
|
echo();
|
1999-08-24 01:06:48 +00:00
|
|
|
|
|
|
|
#if 0
|
2001-05-17 08:21:06 +00:00
|
|
|
trace(TRACE_UPDATE | TRACE_CALLS);
|
1999-08-24 01:06:48 +00:00
|
|
|
#endif
|
2001-05-17 08:21:06 +00:00
|
|
|
while (argc > 1) {
|
2002-05-21 05:30:25 +00:00
|
|
|
if (isdigit(UChar(*argv[1])))
|
2001-05-17 08:21:06 +00:00
|
|
|
move(atoi(argv[1]), 0);
|
|
|
|
else if (!strcmp(argv[1], "-k"))
|
|
|
|
keypad(stdscr, TRUE);
|
|
|
|
argc--, argv++;
|
|
|
|
}
|
1999-08-24 01:06:48 +00:00
|
|
|
|
2001-05-17 08:21:06 +00:00
|
|
|
while (badanswer) {
|
|
|
|
printw("Enter a number (0 to quit):\n");
|
|
|
|
printw("--> ");
|
|
|
|
scanw("%20ld", response); /* yes, it's a pointer */
|
|
|
|
}
|
|
|
|
endwin();
|
2002-05-21 05:30:25 +00:00
|
|
|
ExitProgram(EXIT_SUCCESS);
|
1999-08-24 01:06:48 +00:00
|
|
|
}
|