<?
// test.php
function quit()
{
Gtk::main_quit();
}
$window = new GtkWindow();
$window->set_default_size(260,100);
$window->set_title("GTK HBOX");
$window->connect("destroy","quit");
$button1 = new GtkButton("button1");
$button2 = new GtkButton("button2");
$hbox = new GtkHBox(True,1); // 创建一个HBox对象 均匀填充为True ,和其他容器的间距为1
$hbox->pack_start($button1,true,true); // 把button1装入到HBox里
$hbox->pack_start($button2,true,true); // 把button2装入到HBox里
/*
GtkHBox pack_start函数原形:
void pack_start(GtkWidget child [, bool expand = true [, bool fill = true [, int padding = 0]]]);
*/
$window->add($hbox);
$window->show_all(); // 显示窗体
Gtk::main(); //进入GTK主循环
?>