PHP-GTK
Saturday, August 30, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkTearoffMenuItem
GtkTextAttributesnext

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

GtkTearoffMenuItem Constructor

This constructor doesn't have any parameters; just instantiate and add it to a GtkMenu via its add() method.

Example 118. Detaching a menu

<?php
//The menu will look like this:
// [File            ]
//  + -----------
//  + New
//  + Open
//  + Save
 
//Create a menu bar to add the file menu to
$menubar = new GtkMenuBar();
 
//File menu
$file = new GtkMenuItem('_File');
$menubar->add($file);
//Menu to hold the items
$mnuFile = new GtkMenu();
$file->set_submenu($mnuFile);
 
//Add the tearoff menu item to the file menu
$mnuFile->add(new GtkTearOffMenuItem());
//Add the normal menu items
$mnuFile->add(new GtkImageMenuItem(Gtk::STOCK_NEW));
$mnuFile->add(new GtkImageMenuItem(Gtk::STOCK_OPEN));
$mnuFile->add(new GtkImageMenuItem(Gtk::STOCK_SAVE));
 
 
//standard stuff for window creation
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));
$wnd->add($menubar);
$wnd->show_all();
Gtk::main();
?>

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


previousGtkTearoffMenuItem
GtkTextAttributesnext

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