PHP-GTK
Code:
#!/usr/bin/php
<?php
if (!class_exists("Gtk"))
{
echo "Error: PHP-GTK libraries are not installed.";
exit(1);
}
function on_okay_clicked($label, $entry)
{
$label->set_text("Hello, ".ucfirst($entry->get_text())."! Welcome to Ubuntu!");
}
$window = new GtkWindow(Gtk::WINDOW_TOPLEVEL);
$window->set_title("Hello Ubuntu");
$vbox = new GtkVBox(true, 0);
$label = new GtkLabel("Hi, Whats your name?");
$entry = new GtkEntry(null, 20);
$button = GtkButton::new_from_stock(Gtk::STOCK_OK);
$window->connect_simple("destroy", array("Gtk", "main_quit"));
$button->connect_simple("clicked", "on_okay_clicked", $label, $entry);
$vbox->pack_start($label, true, true, 0);
$vbox->pack_start($entry, true, true, 0);
$vbox->pack_start($button, true, true, 0);
$window->add($vbox);
$window->show_all();
Gtk::main();
?>
Get PHP-GTK from: http://gtk.php.net/
Bookmarks