<?php
/**
* @package : ProgressBar bar file example
* @version : 1.0
* @author : José Augusto Ferreira Franco <hide@address.com>
* @Webname : Webmaster Guto Ferreira
* @Web : http://guto.awardspace.com
*/
/*
*@ (pt) Carrega a livraria do PHP-GTK
*@ (en) Loads the PHP-GTK dll
**/
dl("php_gtk.dll");
/*
*@ (pt) Chama a classe
*@ (en) Calls the class
**/
require "ProgressBar.class.php";
/*
*@ (pt) Um pequeno examplo que usa esta classe
*@ (en) A short example that uses this class
***/
global $window;
$window = &new GTKWindow();
$window->set_title("Class ProgressBar by Guto Ferreira");
$window->connect('destroy','shutdown');
$fixed = &new GTKFixed();
$fixed->set_usize(320,100);
$bar = new ProgressBar($fixed,10,10,0,10);
$bar->Progress($fixed,200,10);
Gtk::timeout_add(10000,'run_app'); // after 10 seconds a new window will open
$window->add($fixed);
$window->show_all();
GTK::main();
function run_app()
{
global $window;
$window->hide();
$new_window = &new GTKWindow();
$new_window->set_title("THIS WINDOW OPENS AFTER THE PROGRESS BAR ENDS ");
$new_window->connect('destroy','shutdown');
$fixed = &new GTKFixed();
$fixed->set_usize(500,100);
$label = &new GtkLabel("THIS IS YOUR MAIN APP");
$fixed->put($label,100,40);
$new_window->add($fixed);
$new_window->show_all();
}
function shutdown()
{
gtk::main_quit();
}
?>