Sets our main struct and passes it to the parent class.
Creates a new gtk.Menu
Creates a gtk.Menu and populates it with menu items and submenus according to model.
Emitted when the position of menu is finalized after being popped up using gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), or gtk_menu_popup_at_pointer ().
Creates and append a submenu to this menu. This menu item that actualy has the sub menu is also created.
Adds a new gtk.MenuItem to a (table) menu. The number of “cells” that an item will occupy is specified by left_attach, right_attach, top_attach and bottom_attach. These each represent the leftmost, rightmost, uppermost and lower column and row numbers of the table. (Columns and rows are indexed from zero).
Attaches the menu to the widget and provides a callback function that will be invoked when the menu calls Menu.detach during its destruction.
Detaches the menu from the widget to which it had been attached. This function will call the callback function, detacher, provided when the Menu.attachToWidget function was called.
Gets the gtk.AccelGroup which holds global accelerators for the menu. See Menu.setAccelGroup.
Retrieves the accelerator path set on the menu.
Returns the selected menu item from the menu. This is used by the gtk.ComboBox
Returns the gtk.Widget that the menu is attached to.
Get the main Gtk struct
Retrieves the number of the monitor on which to show the menu.
Returns whether the menu reserves space for toggles and icons, regardless of their actual presence.
the main Gtk struct as a void*
Returns whether the menu is torn off. See Menu.setTearoffState.
Returns the title of the menu. See Menu.setTitle.
Places menu on the given monitor.
Removes the menu from the screen.
Popups up this menu
Displays a menu and makes it available for selection.
Displays menu and makes it available for selection.
Displays menu and makes it available for selection.
Displays menu and makes it available for selection.
Displays a menu and makes it available for selection.
Moves child to a new position in the list of menu children.
Repositions the menu according to its position function.
Set the gtk.AccelGroup which holds global accelerators for the menu. This accelerator group needs to also be added to all windows that this menu is being used in with Window.addAccelGroup, in order for those windows to support all the accelerators contained in this group.
Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. The main purpose of this function is to spare the programmer the inconvenience of having to call Menu.itemSetAccelPath on each menu item that should support runtime user changable accelerators. Instead, by just calling Menu.setAccelPath on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned.
Selects the specified menu item within the menu. This is used by the gtk.ComboBox and should not be used by anyone else.
Informs GTK+ on which monitor a menu should be popped up. See gdk_monitor_get_geometry().
Sets whether the menu should reserve space for drawing toggles or icons, regardless of their actual presence.
Sets the gdk.Screen on which the menu will be displayed.
Changes the tearoff state of the menu. A menu is normally displayed as drop down menu which persists as long as the menu is active. It can also be displayed as a tearoff menu which persists until it is closed or reattached.
Sets the title string for the menu.
Returns a list of the menus which are attached to this widget. This list is owned by GTK+ and must not be modified.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Activates the menu item within the menu shell.
Adds a new gtk.MenuItem to the end of the menu shell's item list.
Establishes a binding between a gtk.MenuShell and a gio.MenuModel
Cancels the selection within the menu shell.
Deactivates the menu shell.
Deselects the currently selected item from the menu shell, if any.
Gets the parent menu shell.
Gets the currently selected item.
Returns TRUE if the menu shell will take the keyboard focus on popup.
Adds a new gtk.MenuItem to the menu shell’s item list at the position indicated by position.
Adds a new gtk.MenuItem to the beginning of the menu shell's item list.
Select the first visible or selectable child of the menu shell; don’t select tearoff items unless the only item is a tearoff item.
Selects the menu item from the menu shell.
If take_focus is TRUE (the default) the menu shell will take the keyboard focus so that it will receive all keyboard events which is needed to enable keyboard navigation in menus.
An action signal that activates the current menu item within the menu shell.
An action signal which cancels the selection within the menu shell. Causes the selection-done signal to be emitted.
A keybinding signal which moves the focus in the given direction.
This signal is emitted when a menu shell is deactivated.
The ::insert signal is emitted when a new gtk.MenuItem is added to a gtk.MenuShell A separate signal is used instead of GtkContainer::add because of the need for an additional position parameter.
An keybinding signal which moves the current menu item in the direction specified by direction.
The ::move-selected signal is emitted to move the selection to another item.
This signal is emitted when a selection has been completed within a menu shell.
A gtk.Menu is a gtk.MenuShell that implements a drop down menu consisting of a list of gtk.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 gtk.MenuItem in a gtk.MenuBar or popped up by activating a gtk.MenuItem in another gtk.Menu
A gtk.Menu can also be popped up by activating a gtk.ComboBox Other composite widgets such as the gtk.Notebook can pop up a gtk.Menu as well.
Applications can display a gtk.Menu as a popup menu by calling the Menu.popup function. The example below shows how an application can pop up a menu when the 3rd mouse button is pressed.
Connecting the popup signal handler.
Signal handler which displays a popup menu.
CSS nodes
|[<!-- language="plain" --> menu ├── arrow.top ├── <child> ┊ ├── <child> ╰── arrow.bottom