slide show.
| From: | Danny Auble | Date: | Mon, 20 Oct 2003 16:47:48 +0000 |
| Subject: | slide show. | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-3968@lists.php.net to get a copy of this message | ||
I am trying to get a automatic update of xpms working. I can't figure out
how to make my vbox update though. here is the code. I change the picture
in the background, so the picture is the same name, just a different
picture. Any help would be great, thanks,
Danny
<?
if (!class_exists('gtk')) {
if (strtoupper(substr(PHP_OS, 0,3) == 'WIN'))
dl('php_gtk.dll');
else
dl('php_gtk.so');
}
function quitApp() {
GLOBAL $id;
Gtk::timeout_remove($id);
Gtk::main_quit();
}
function refresh ()
{
global $win;
global $vbox;
list($pixmap, $mask) =
Gdk::pixmap_create_from_xpm($win->window,null,'chart.xpm');
$image = &new GtkPixmap($pixmap, $mask);
$vbox->pack_start($image,FALSE,FALSE,0);
$image->show();
return 1;
}
$win = &new GtkWindow();
$win->set_position(GTK_WIN_POS_CENTER);
$win->set_border_width(10);
$win->connect('delete_event', 'quitApp' );
$vbox = &new GtkVbox();
$win->add($vbox);
$id = Gtk::timeout_add (1000, 'refresh');
$win->show_all();
gtk::main();
?>