Location: PHPKode > scripts > Menu Editable > menu-editable/sample.php
if(strtoupper(substr(PHP_OS, 0,3)) == 'WIN')

$w = &new gtkwindow();

// We realize the window to get the gdkwindow needed to 
// create Xpm if we want to display icons in our menu
$gdkwindow  = $w->window;

// We also create a gtkaccelgroup to manage accelkeys
// the class menu will attempt to create its own if none is given at creation time
$accelgroup = &new gtkaccelgroup();

// So we declare the menu and add it to the window
$menu = &new menu($gdkwindow,$accelgroup);

// We now can add entrys to the menu
// first the file menu 
// Second we want a open file option in the file menu
//we also want a separator in the menu file
$menu->add_menu_item('quit','file','_quit','shutdown','img/exit.xpm'); # you can now pass $xpmdatas or array(gdkpixmap,gdkkbitmask) instead of a file as image
//You can add check menu item too by setting is_checkmenuitem patameter to TRUE.

# now add an entry with a beautifull right click menu
$box = &new gtkvbox();
$entry = &new gtkentry();
$menueditable = &new menu_editable($gdkwindow,$accelgroup);

function shutdown(){
Return current item: Menu Editable