set_title('window one'); $window2 = new nCursesWindow(10,20, 5,10, 'window two long title test 1 2 3 4 5'); nCurses::refresh(); // will be handeled by nCurses class $window->refresh(); // will be handeled by nCurses class $window2->refresh(); // will be handeled by nCurses class nCurses::main(); ?> 0); protected function __construct(){} protected function __clone(){} static public function end(){ ncurses_end(); } static public function get_screen_size(){ $screen = ncurses_newwin ( 0, 0, 0, 0); ncurses_getmaxyx($screen, $rows,$cols); ncurses_delwin($screen); return array('rows'=>$rows, 'cols'=>$cols); } static public function refresh(){ ncurses_refresh(); } static public function init(){ ncurses_init(); ncurses_start_color(); register_shutdown_function(array('nCurses','end')); } static public function main(){ // this needs bulking out to handel windows and mouse stuff self::$mainloop = true; ncurses_timeout(0); while(self::$mainloop){ $key = ncurses_getch(); if ($key == nCursesKey::ESC) nCurses::main_quit(); } } static public function main_quit(){ self::$mainloop = false; } } require_once('ncurses/key.php'); require_once('ncurses/window.php'); require_once('ncurses/button.php'); require_once('ncurses/dialog.php'); ?>