assert(open_dll('nc'));
nc_initscr();
nc_capture_cout(stdscr);
nc_scrollok(stdscr,true);
nc_noecho();
var sub = nc_subwin(stdscr,3,4,5,6);
nc_wbkgd( sub, ncurses["-"] | nc_color("white","red"));
// print(ncurses.toSource());
nc_wmove(stdscr,12,0);
print("nc_getparyx(sub) ==",nc_getparyx(sub).toSource());
print("nc_getparyx(sub).y ==",nc_getparyx(sub).y);
print("nc_getpary(sub) ==",nc_getpary(sub));
print("nc_getparx(sub) ==",nc_getparx(sub));
print('ncurses.MOUSE_VERSION ==',ncurses.MOUSE_VERSION);
if( ncurses.MOUSE_VERSION ) {
print("Play with the mouse. Tap 'q' to quit.");
var key = 0;
while( ascii('q') != (key = nc_getch()) ) {
if( key == ncurses.KEY_MOUSE ) {
var evt = nc_getmouse();
print( "mouse :",key,evt.toSource() );
}
}
}
print("Tap any key to exit.");
nc_getch();
nc_delwin(sub);
nc_endwin();
|