The following comes from the Linux beginning programming
#include <unistd.h>
#include <stdlib.h>
#include <curses.h>
int main ()
{
WINDOW *new_window_ptr;
WINDOW *popup_window_ptr;
int x_loop;
int 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 ';
}
}
/*update the screen*/
Refresh ();
Sleep (2);
New_window_ptr = Newwin (10,20,5,5);
MVWPRINTW (new_window_ptr,2,2, "%s", "Hello World");
MVWPRINTW (new_window_ptr,5,2, "%s", "notice how very long lines wrap the window");
Wrefresh (NEW_WINDOW_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);
Wrefresh (NEW_WINDOW_PTR);
Sleep (2);
Touchwin (NEW_WINDOW_PTR);
Wrefresh (NEW_WINDOW_PTR);
Sleep (2);
Popup_window_ptr=newwin (10,20,8,8);
Box (popup_window_ptr, ' | ', '-');
MVWPRINTW (popup_window_ptr,5,2, "%s", "Pop Up window!");
Wrefresh (POPUP_WINDOW_PTR);
Sleep (2);
Touchwin (NEW_WINDOW_PTR);
Wrefresh (NEW_WINDOW_PTR);
Sleep (2);
Wclear (NEW_WINDOW_PTR);
Wrefresh (NEW_WINDOW_PTR);
Sleep (2);
Delwin (NEW_WINDOW_PTR);
Touchwin (POPUP_WINDOW_PTR);
Wrefresh (POPUP_WINDOW_PTR);
Sleep (2);
Delwin (POPUP_WINDOW_PTR);
Touchwin (STDSCR);
Refresh ();
Sleep (2);
Endwin ();
Exit (0);
}