require 'rubygems'
require 'ncurses'

Ncurses.initscr
height = Ncurses.LINES() - 3
width = Ncurses.COLS()

outputwin = Ncurses.WINDOW.new(height, width, 0, 0)

failure = "-" * Ncurses.COLS()

Ncurses.mvprintw(22, 0, failure)
Ncurses.refresh

test = ""
Ncurses.mvwgetstr(Ncurses.stdscr, Ncurses.LINES() - 1, 0, test)

outputwin.addstr(test)
outputwin.refresh

sleep 1
Ncurses.endwin

Thats the code. If I comment out the first initialization of
'outputwin', the code runs fine up to the point where it gives me a name
error over outputwin.addstr, which is expected. But if I uncomment it, I
don't get any errors, but some weird actions. When I run the ruby
script, it clears the screen, displays my terminal prompt again, and
text typed doesn't show up (like the Ncurses mode didn't end correctly).
Does anyone know whats wrong with my outputwin?
-- 
Posted via http://www.ruby-forum.com/.