-WINDOW *win;
-int w, x, y, i, j, k;
-char buffer[200];
-const char *message;
-int width, height;
-chtype save[80];
-chtype c;
-
- initscr();
- start_color();
- cbreak();
- signal(SIGINT, trap);
- width = 48;
- height = 14; /* Create a drawing window */
- win = newwin(height, width, (LINES-height)/2, (COLS-width)/2);
- if(win == NULL)
- { endwin();
- return 1;
- }
-
- while(1)
- { init_pair(1,COLOR_WHITE,COLOR_BLUE);
- wattrset(win, COLOR_PAIR(1));
- werase(win);
-
- init_pair(2,COLOR_RED,COLOR_RED);
- wattrset(win, COLOR_PAIR(2));
- box(win, ACS_VLINE, ACS_HLINE);
- wrefresh(win);
- /* Do ramdom output of a character */
- wattrset(win, COLOR_PAIR(1));
- c = 'a';
- for(i=0; i < 5000; ++i)
- { x = rand() % (width-2) + 1;
- y = rand() % (height-2) + 1;
- mvwaddch(win, y, x, c);
- wrefresh(win);
- nodelay(win,TRUE);
- if (wgetch(win) != ERR)
- break;
- if(i == 2000)
- { c = 'b';
- init_pair(3,COLOR_CYAN,COLOR_YELLOW);
- wattron(win, COLOR_PAIR(3));
- }
- }
-
- SubWinTest(win);
- /* Erase and draw green window */
- init_pair(4,COLOR_YELLOW,COLOR_GREEN);
- wbkgd(win, COLOR_PAIR(4) | A_BOLD);
- wattrset(win, COLOR_PAIR(4) | A_BOLD);
- werase(win);
- wrefresh(win);
- /* Draw RED bounding box */
- wattrset(win, COLOR_PAIR(2));
- box(win, ' ', ' ');
- wrefresh(win);
- /* Display Australia map */
- wattrset(win, COLOR_PAIR(4) | A_BOLD);
- i = 0;
- while(*AusMap[i])
- { mvwaddstr(win, i+1, 8, AusMap[i]);
- wrefresh(win);
- delay_output(50);
- ++i;
- }
-
- init_pair(5,COLOR_BLUE,COLOR_WHITE);
- wattrset(win, COLOR_PAIR(5) | A_BLINK);
- mvwaddstr(win, height-2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix");
- wrefresh(win);
-
- /* Draw running messages */
- init_pair(6,COLOR_YELLOW,COLOR_WHITE);
- wattrset(win, COLOR_PAIR(6));
- message = messages[j = 0];
- i = 1;
- w = width-2;
- strcpy(buffer, message);
- while(j < NMESSAGES) {
- while ((int)strlen(buffer) < w) {
- strcat(buffer, " ... ");
- strcat(buffer, messages[++j % NMESSAGES]);
- }