Create window.php file
<?php
/*
PHP GTK tutorials
website: http://phpgtktutorials.blogspot.in/
*/
$window = new GtkWindow();
$window->set_title("Signal Handling in PHP GTK");
$window->connect_simple("destroy",array("Gtk","main_quit"));
$button1 = new GtkButton("Button 1");
$button2 = new GtkButton("Button 2");
function signalClicked($button)
{
echo $button->get_label()." was clicked.\n";
}
$button1->connect("clicked","signalClicked");
$button2->connect("clicked","signalClicked");
$bb = new GtkHButtonBox();
$bb->set_layout(Gtk::BUTTONBOX_EDGE);
$bb->add($button1);
$bb->add($button2);
$window->add($bb);
$window->show_all();
Gtk::main();
?>

0 comments:
Post a Comment