Over a million developers have joined DZone.

Ncurses

·

#include 

int main() {

   int c;
   WINDOW *config_win;

   initscr();
   cbreak();
   noecho();

   config_win = newwin(10,20,1,1);
   mvwaddstr(config_win, 1,1, "test");

   while (c = wgetch(config_win)) {
      switch(c) {
         case 'a':
         delwin(config_win);
         config_win = newwin(10,20,1,1);
         mvwaddstr(config_win, 1,1, "print this");
         wrefresh(config_win);
         break;

         default:
         delwin(config_win);
         config_win = newwin(10,20,1,1);
         mvwaddstr(config_win, 1,1, "hello");
         wrefresh(config_win);
         break;
      }
   }

   endwin();
}

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}