scanner/ncurses/example.php
Correl Roush 570f8aaa65 Several updates, most noticeably a new ncurses interface (using argument --curses) Mantis: 2691
git-svn-id: file:///srv/svn/scanner/trunk@8 a0501263-5b7a-4423-a8ba-1edf086583e7
2008-02-28 16:39:33 +00:00

27 lines
844 B
PHP

<?php
require_once( 'ncurses.php' );
class MyApp extends NcApp {
function run() {
$nc_main = new NcWindow( $this, 0, 0, 0, 0 );
$nc_main->title( 'Hello There' );
$nc_main->write( 0, 0, file_get_contents( __FILE__ ) );
$nc_main->get_char();
$nc_small = new NcWindow( $nc_main, 10, 60, 5, 20 );
$nc_small->title( 'Progress Bars' );
ncurses_attron( NCURSES_A_REVERSE );
$bar_1 = new NcProgressBar( $nc_small, 0, 0, 0, 100, true );
$bar_1->pos( 57 );
$bar_2 = new NcProgressBar( $nc_small, 0, 1, 0, 100, false );
$bar_2->pos( 11 );
$nc_small->write( 3, 0, 'Text Input:' );
$input = new NcTextInput( $nc_small, -12, 3, 12 );
$foo = $input->get();
$nc_small->write_centered( 4, 'Press any key to destroy this window' );
$nc_small->get_char();
$nc_small->hide();
$nc_main->get_char();
}
}
$app = new MyApp();
?>