xavier_r Posted July 18, 2007 Share Posted July 18, 2007 OK... so i have this code... in PHP using Ncurses... while(1) { ... display_time() ... ncurses_getch($lower_main_window) //wait for pressing key ... ... ... } In this Ncurse app, I want to display changing time continously(real time)... whether or not the user presses a key... But in my code... The program has to wait for a key... and so time change is not shown untul the users presses a key... How to solve this? Quote Link to comment Share on other sites More sharing options...
wmbetts Posted July 25, 2007 Share Posted July 25, 2007 <?php function display_time($scr) { $time = date("H:i:s"); ncurses_mvwaddstr($scr,25,75,$time); ncurses_wrefresh($scr); } $cur = ncurses_init(); $fs = ncurses_newwin(0,0,0,0); while (1) { display_time($fs); } ?> you just need to get ride of the ncurses_getch() call Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.