1994-10-07 08:58:58 +00:00
|
|
|
#include <ncurses.h>
|
|
|
|
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
WINDOW *win1, *win2;
|
|
|
|
int h, i;
|
|
|
|
|
|
|
|
initscr();
|
|
|
|
cbreak();
|
|
|
|
noecho();
|
|
|
|
win1 = newwin(20, 50, 0, 20);
|
|
|
|
for (h = 0; h < 20; h++)
|
|
|
|
for (i = 0; i < 50; i++)
|
|
|
|
mvwaddch(win1, h, i, 'X');
|
|
|
|
wrefresh(win1);
|
|
|
|
getch();
|
|
|
|
|
|
|
|
win2 = newwin(20, 50, 3, 30);
|
|
|
|
for (h = 0; h < 20; h++)
|
|
|
|
for (i = 0; i < 50; i++)
|
|
|
|
mvwaddch(win2, h, i, 'Y');
|
|
|
|
wnoutrefresh(win1);
|
|
|
|
wnoutrefresh(win2);
|
|
|
|
doupdate();
|
|
|
|
getch();
|
|
|
|
|
|
|
|
/* now, remove window 2 and restore the contents of window 1 */
|
1995-05-30 05:51:47 +00:00
|
|
|
i = copywin(win1, win2, 5, 10, 0, 0, 14, 39, 0);
|
1994-10-07 08:58:58 +00:00
|
|
|
wnoutrefresh(win1);
|
|
|
|
wnoutrefresh(win2);
|
|
|
|
printw("copywin returns %d\n", i);
|
|
|
|
wnoutrefresh(stdscr);
|
|
|
|
doupdate();
|
|
|
|
|
|
|
|
getch();
|
|
|
|
|
|
|
|
endwin();
|
|
|
|
}
|
|
|
|
|