Class GTK2.Menu
- Description
A GTK2.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 GTK2.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 GTK2.Menu.
A GTK2.Menu can also be popped up by activating a W(OptionMenu). Other composite widgets such as the W(Notebook) can pop up a GTK2.Menu as well.
Applications can display a GTK2.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.
GTK2.Menu menu = create_menu(); GTK2.Window window = create_window(); window->signal_connect( "button_press_event", lambda(GTK2.Menu m, GTK2.Window w, mapping e ) { if( e->button == 3 ) menu->popup(); }, menu );
Properties: int tearoff-state string tearoff-titleChild properties: int bottom-attach int left-attach int right-attach int top-attach
Style properties: int horizontal-offset int vertical-offset int vertical-padding
Signals: move_scroll
- Inherit MenuShell
inherit GTK2.MenuShell : MenuShell
- Method create
GTK2.Menu GTK2.Menu(
mapping
|void
props
)- Description
Creates a new GTK2.Menu widget.