PHP-GTK
Saturday, December 20, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkSeparatorMenuItem
GtkSeparatorToolItemnext

Last updated: Sun, 12 May 2013
view this page in English

GtkSeparatorMenuItem Constructor

Separator menu items are used just as any other GtkMenuItem. The following example shows how to use them.

Example 113. Separating menu items with GtkSeparatorMenuItem

<?php
//Example: using GtkSeparatorMenuItems to
// separate menu items
 
//Create a menu bar
$mbar  = new GtkMenuBar();
//Add a menu item
$file  = new GtkMenuItem('_File');
//with a submenu
$fmenu = new GtkMenu();
$file->set_submenu($fmenu);
$mbar->add($file);
 
//Now, we create a "normal" file menu:
// New, Open, Save, Save As, Quit
//To make it visually appealing, we separate
// the items with GtkSeparatorMenuItems
$fmenu->add(new GtkImageMenuItem(Gtk::STOCK_NEW));
$fmenu->add(new GtkImageMenuItem(Gtk::STOCK_OPEN));
 
$fmenu->add(new GtkSeparatorMenuItem());
 
$fmenu->add(new GtkImageMenuItem(Gtk::STOCK_SAVE));
$fmenu->add(new GtkImageMenuItem(Gtk::STOCK_SAVE_AS));
 
$fmenu->add(new GtkSeparatorMenuItem());
 
$fmenu->add(new GtkImageMenuItem(Gtk::STOCK_QUIT));
 
 
//standard stuff
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->add($mbar);
$wnd->show_all();
Gtk::main();
?>

User Contributed Notes
gtk.gtkseparatormenuitem.constructor.php
add a note about notes
There are no user contributed notes for this page.


previousGtkSeparatorMenuItem
GtkSeparatorToolItemnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:00 2013 CEST