int main()
{
WINDOW * new_win_ptr;
WINDOW * pop_win_ptr;
int x_loop,y_loop;
char a_letter='a';
initscr();
move(5,5);
printw("%s","Testing Multiple Windows");
refresh();
for(y_loop=0;y_loop<LINES-1;y_loop++)
for(x_loop=0;x_loop<COLS-1;x_loop++)
{
mvwaddch(stdscr,y_loop,x_loop,a_letter);
a_letter++;
if(a_letter>'z')a_letter='a';
}
refresh();
sleep(2);
new_win_ptr=newwin(10,20,5,5);
mvwprintw(new_win_ptr,2,2,"%s","Hello World!");
mvwprintw(new_win_ptr,5,2,"%s","Notice how long lines wrap incide in this window ,Hello World!");
wrefresh(new_win_ptr);
sleep(2);
a_letter='0';
for(y_loop=0;y_loop<LINES-1;y_loop++)
for(x_loop=0;x_loop<COLS-1;x_loop++)
{
mvwaddch(stdscr,y_loop,x_loop,a_letter);
a_letter++;
if(a_letter>'9')a_letter='0';
}
refresh();
sleep(2);
touchwin(new_win_ptr);
wrefresh(new_win_ptr);
sleep(2);
pop_win_ptr=newwin(10,20,8,8);
box(pop_win_ptr,'|','-');
mvwprintw(pop_win_ptr,5,2,"%s","Pop up Window!");
wrefresh(pop_win_ptr);
sleep(2);
endwin();
exit(EXIT_SUCCESS);
}