Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/gauge.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michele Brodoloni  >  PHP Dialog  >  examples/gauge.php  >  Download  
File: examples/gauge.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Dialog
Create console based UIs with the dialog program
Author: By
Last change: Added phpdoc-style comments to source code (most of)
Added a README file with installation instructions
Made some fixes into main class code
Made some changes to the example scripts and checked if they work

Date: 2012-04-11 17:51
Size: 439 bytes
 

Contents

Class file image Download
#!/usr/bin/php
<?php

require_once('../include/class.dialog.php');

$params = array(
    
'backtitle' => 'Example: Gauge (Progress Bar)',
    
'height'    => 6,
    
'width'     => 30
); 

$dialog Dialog::Factory('gauge'$params);

$dialog->setTitle('Please Wait')
       ->
setCaption('Loading...');

// $dialog->debug();
$dialog->start();

while(
$dialog->getValue() < 90) {
    
sleep(1);
    
$dialog->incrementBy(20);
}

$dialog->stop();

exit();