<?php
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
function here_goes($button) {
$child = $button->child;
echo $child->get()."\n";
}
$window = &new GtkWindow();
$window->connect_object('destroy', array('gtk', 'main_quit'));
$window->set_title('GtkRadioButton demo');
$box = &new GtkVBox();
$window->add($box);
$button1 = &new GtkRadioButton(null, 'button 1');
$button1->connect('pressed', 'here_goes');
$box->pack_start($button1);
for ($i = 2; $i <= 4; $i++) {
$button = &new GtkRadioButton($button1, 'button ' . $i);
$button->connect('pressed', 'here_goes');
$box->pack_start($button);
}
$button_end = &new GtkButton('Exit');
$button_end->connect_object('clicked', array('gtk', 'main_quit'));
$box->pack_end($button_end);
$window->show_all();
gtk::main();
?>
|