[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-gtk-general
Subject:    [PHP-GTK] slide show.
From:       Danny Auble <da () llnl ! gov>
Date:       2003-10-20 16:47:48
[Download RAW message or body]

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();

?>

-- 
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic