<?php
if( !extension_loaded('gtk')) {
dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
}
$window = &new GtkWindow();
$window->set_default_size( 300, 20);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$accelgroup = &new GtkAccelGroup();
$window->add_accel_group( $accelgroup);
$fac = &new GtkItemFactory( GtkMenuBar::get_type(), "<mainmenu>", $accelgroup);
function quit( $number, $item) {
gtk::main_quit();
}
$arItems = array(
array( "/_File/_Open", null, null, 0, null ),
array( "/_File/_Save", null, null, 0, null ),
array( "/_File/_Quit", "<CTRL>Q", 'quit', 0, null )
);
$fac->create_items( $arItems);
$window->add( $fac->get_widget( "<mainmenu>"));
$window->show_all();
gtk::main();
?>
|