GtkMenuBar Constructor

GtkMenuBar ();

Use the constructor to create a new GtkMenuBar widget and then add GtkMenuItems to it.

This widget is a subclass of GtkMenuShell, hence all methods that can be applied to GtkMenuShell may be used here.

Example 101. Creating a simple menu bar

//Create a simple menu bar
$menubar = new GtkMenuBar();

//Add File menu item with a dropdown menu
$file = new GtkMenuItem('_File');

//Quit item
$quit = new GtkMenuItem('_Quit');

//This menu will popup when the File menu is activated
$mnuFile = new GtkMenu();
//Add the Quit item to the File popup menu

//Set the popupmenu of the File menu item

//another menu item
$edit = new GtkMenuItem('_Edit');

//Add the menu bar to the window
$wnd = new GtkWindow();

$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));