/************************************************************************ * * * Copyright Digital Equipment Corporation 1998. All rights reserved. * * * * Restricted Rights: Use, duplication, or disclosure by the U.S. * * Government is subject to restrictions as set forth in subparagraph * * (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR * * 52.227-14 Alt. III, as applicable. * * * * This software is proprietary to and embodies the confidential * * technology of Digital Equipment Corporation. Possession, use, or * * copying of this software and media is authorized only pursuant to a * * valid written license from Digital or an authorized sublicensor. * * * ************************************************************************/ /* chap_6_stdscr_occlude.c */ /* This program defines one window: win1. win1 is */ /* located towards the center of the default window */ /* stdscr. When writing to an occluding window (win1) */ /* that is later erased, the writing is erased as well. */ #include /* Include header file. */ WINDOW *win1; /* Define windows. */ main() { char str[80]; /* Variable declaration.*/ initscr(); /* Set up Curses. */ noecho(); /* Turn off echo. */ /* Create window. */ win1 = newwin(10, 20, 10, 10); box(stdscr, '|', '-'); /* Draw a box around stdscr. */ box(win1, '|', '-'); /* Draw a box around win1. */ refresh(); /* Display stdscr on screen. */ wrefresh(win1); /* Display win1 on screen. */ getstr(str); /* Pause. Type a few words! */ mvaddstr(22, 1, str); getch(); /* Add string to win1. */ mvwaddstr(win1, 5, 5, "Hello"); wrefresh(win1); /* Add win1 to terminal scr. */ getch(); /* Pause. Press Return. */ delwin(win1); /* Delete win1. */ touchwin(stdscr); /* Refresh all of stdscr. */ getch(); /* Pause. Press Return. */ endwin(); /* Ends session. */ }