emit_log_filter[] = 'change'; } } class MyEventApp extends NcApp { function init() { $this->screen->title('Ncurses Example Application'); $input = array(); for($i = 0; $i < 3; $i++) { $input[] = new NcTextInput($this->screen, 0, 2*$i, 0); } $log = new LogView($this->screen, $this->screen->height() - 11, 0, 7, 0, array( 'columns' => array( 'class' => 'Class', 'message' => 'Message' ) )); $log->title('Application Log'); $progress = new NcProgressBar($this->screen, 0, $this->screen->height() - 4, 0); $button = new NcButton($this->screen, 3, 10, $this->screen->height() - 3, 0, 'Quit'); Signaler::connect($this, 'log', $log, 'load'); Signaler::connect($log, 'change', $progress, 'pos'); Signaler::connect($this, 'log_items', $progress, 'max'); Signaler::connect($button, 'clicked', $this, 'quit'); $log->load($this->log); } function log(&$object, $message) { parent::log($object, $message); $this->emit('log_items', count($this->log) - 1); } } $app = new MyEventApp(); $app->exec(); ?>