#include <stdio.h>
#include <curses.h>

main()
{
       WINDOW *win, *sub, *sub2;
       char tmp[80];
       int i;

       initscr();
       raw();
       noecho();
       keypad(stdscr, TRUE);
       nodelay(stdscr, FALSE);

       win = newwin(20, 45, 2, 10);
       keypad(win, TRUE);
       nodelay(win, FALSE);
       box(win, 0, 0);

       sub = derwin(win, 14, 35, 3, 3);
       box(sub, 0, 0);
       mvwaddstr(sub, 1, 1, "This is the 1st sub");

       sub2 = derwin(sub, 10, 20, 3, 3);
       box(sub2, 0, 0);

       mvwaddstr(sub2, 1, 1, "Karl");
       wsyncup(sub2);
       wcursyncup(sub2);

       wgetch(win);

       mvwaddstr(sub2, 2, 1, "Lisabon");
       wsyncup(sub2);
       wcursyncup(sub2);

       wgetch(win);

       erase();
       refresh();
       mvwin(win, 2, 2);

       mvwaddstr(sub2, 3, 1, "Portos");
       wsyncup(sub2);
       wcursyncup(sub2);

       wgetch(win);

       mvwaddstr(win, 5, 1, "Trottoarbollar �r trevliga att kasta");

       wgetch(win);

       endwin();
       exit(0);

}