[UP] use ARROW_HOST to sep script
[arrow.git] / ncurses / scrollwin.c
blob05678c5519cd440eb7cdd272637bbcec59adb70d
1 #include <stdlib.h>
2 #include <ncurses.h>
3 #include <signal.h>
4 #include <unistd.h>
5 static void finish(int sig);
6 WINDOW *scrwin, *boxwin;
7 int main(int argc, char *argv[])
9 int i;
11 initscr();
12 cbreak();
13 noecho();
14 nonl();
15 scrwin = newwin(10, 40, LINES / 2 - 6, COLS / 2 - 25);
16 boxwin = newwin(12, 42, LINES / 2 - 7, COLS / 2 - 26);
17 scrollok(scrwin, 1);
18 box(boxwin, '|', '-');
19 refresh();
20 wrefresh(boxwin);
21 signal(SIGINT, finish);
22 signal(SIGQUIT, finish);
23 for (i = 0;; i++) {
24 if (i % 20 == 0)
25 sleep(1);
26 wprintw(scrwin, "the string is %d\n", i % 9);
27 wrefresh(scrwin);
29 return 0;
31 static void finish(int sig)
33 endwin();
34 exit(0);