title: Window positioning in ncurses
body: <p>I'm attempting to write a simple chat application in C using ncurses, both of which I am new to with a background in PHP. (Yes, I know.  Thanks.  I'll take that advice to heart. Please put down the guns.)</p>
  
  <p>What I've attempted to do is create two windows, one for input and one for channel text, like so:</p>
  
  <pre><code>int termwidth = getmaxy(stdscr);
  int termheight = getmaxx(stdscr);
  
  WINDOW *channel = newwin(termwidth, termheight - 1, 0, 0);
  scrollok(channel, TRUE);
  
  WINDOW *input = newwin(termwidth, 1, termheight + 1, 0);
  scrollok(input, TRUE);
  </code></pre>
  
  <p>and then set cursor position to input:</p>
  
  <pre><code>wmove(input, 0, 0);
  </code></pre>
  
  <p>in order to put typed input in the second window, which should occupy a single column at the bottom of the terminal, while output appears in the first window which fills the rest of the terminal's space.</p>
  
  <p>Output <em>appears</em> to fill the top window (channel) properly, with the input cursor flashing in the proper place, but changing its size does not yield predictable results and typed input doesn't appear to be going into the input window at all.</p>
  
  <p>The complete source is available here: <a href="http://pastebin.com/X8apHUgh" rel="nofollow">http://pastebin.com/X8apHUgh</a></p>
  
  <p><strong>To sum up, I am asking why input is behaving unexpectedly, and why drawing the "channel" window is yielding strange results.</strong> </p>