program cursestest; import Curses; Void main() { try { initScreen(); cbreakMode(true); echoMode(false); newlineMode(false); intrFlush(stdscr, false); startColour(); setCursor(Invisible); if (hasColours()) { initPair(1,Red,Black); initPair(2,Green,Yellow); } box(stdscr); refresh(); win = newWin(10,60,5,5); wAttributes(win,[Bold,ColourPair(1)],true); intrFlush(win,false); box(win); wRefresh(win); wMove(win,2,5); waddStr(win,"Hello world!"); wAttributes(win,[Bold],false); wAttributes(win,[Normal, ColourPair(2)],true); wMove(win,7,35); waddStr(win,"Foo!"); wRefresh(win); refresh(); x = wgetChar(win); endWin(); putStrLn("You pressed '"+x+"'"); } catch(e) { endWin(); throw(e); } }