title: How to scroll a window (other than stdscreen) in ncurses?
body: <p>I saw this answer researching to solve my problem <a href="https://stackoverflow.com/a/8407120/2570513">https://stackoverflow.com/a/8407120/2570513</a>, but, it works only on stdscreen. I implemented this:</p>
  
  <pre><code>#include &lt;ncurses.h&gt;
  
  int main(void)
  {
      int i = 2, height, width;
      WINDOW *new;
  
      initscr();
      getmaxyx(stdscr, height, width);
      new = newwin(height - 2, width - 2, 1, 1);
  
      scrollok(new,TRUE);
  
      while(1)
      {
          mvwprintw(new, i, 2, "%d - lots and lots of lines flowing down the terminal", i);
          ++i;
          wrefresh(new);
      }
  
      endwin();
      return 0;
  }
  </code></pre>
  
  <p>But it doesn't scroll. Whats wrong?</p>