Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
GTK
GTK.Menu

Class GTK.Menu

Description

A GTK.Menu is a W(MenuShell) that implements a drop down menu consisting of a list of W(MenuItem) objects which can be navigated and activated by the user to perform application functions.

A GTK.Menu is most commonly dropped down by activating a W(MenuItem) in a W(MenuBar) or popped up by activating a W(MenuItem) in another GTK.Menu.

A GTK.Menu can also be popped up by activating a W(OptionMenu). Other composite widgets such as the W(Notebook) can pop up a GTK.Menu as well.

Applications can display a GTK.Menu as a popup menu by calling the popup() function. The example below shows how an application can pop up a menu when the 3rd mouse button is pressed.

   GTK.Menu menu = create_menu();
   GTK.Window window = create_window();
   window->signal_connect( "button_press_event", lambda(GTK.Menu m,
                                                        GTK.Window w,
                                                        mapping e ) {
             if( e->button == 3 )
              menu->popup();
          }, menu );
 


Inherit MenuShell

inherit GTK.MenuShell : MenuShell