Adds a new #GtkMenuItem 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).
Connect to MoveScroll signal.
Connect to PoppedUp signal.
Detaches the menu from the widget to which it had been attached. This function will call the callback function, detacher, provided when the gtk.menu.Menu.attachToWidget function was called.
Gets the #GtkAccelGroup which holds global accelerators for the menu. See gtk.menu.Menu.setAccelGroup.
Retrieves the accelerator path set on the menu.
Returns the selected menu item from the menu. This is used by the #GtkComboBox.
Returns the #GtkWidget that the menu is attached to.
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.
Returns whether the menu is torn off. See gtk.menu.Menu.setTearoffState.
Returns the title of the menu. See gtk.menu.Menu.setTitle.
Places menu on the given monitor.
Removes the menu from the screen.
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.
Returns this, for use in with statements.
Set the #GtkAccelGroup 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 gtk.window.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 gtk.menu_item.MenuItem.setAccelPath on each menu item that should support runtime user changable accelerators. Instead, by just calling gtk.menu.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 #GtkComboBox and should not be used by anyone else.
Informs GTK+ on which monitor a menu should be popped up. See gdk.monitor.MonitorWrap.getGeometry.
Sets whether the menu should reserve space for drawing toggles or icons, regardless of their actual presence.
Sets the #GdkScreen 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.
Get accelGroup property.
Set accelGroup property.
Get accelPath property.
Set accelPath property.
Get active property.
Set active property.
Get anchorHints property.
Set anchorHints property.
Get attachWidget property.
Set attachWidget property.
Get menuTypeHint property.
Set menuTypeHint property.
Get monitor property.
Set monitor property.
Get rectAnchorDx property.
Set rectAnchorDx property.
Get rectAnchorDy property.
Set rectAnchorDy property.
Get reserveToggleSize property.
Set reserveToggleSize property.
Get tearoffState property.
Set tearoffState property.
Get tearoffTitle property.
Set tearoffTitle property.
Get builder for gtk.menu.Menu
Returns a list of the menus which are attached to this widget. This list is owned by GTK+ and must not be modified.
Creates a #GtkMenu and populates it with menu items and submenus according to model.
Returns this, for use in with statements.
Get builder for gtk.menu_shell.MenuShell
Get takeFocus property.
Set takeFocus property.
Activates the menu item within the menu shell.
Adds a new #GtkMenuItem to the end of the menu shell's item list.
Establishes a binding between a #GtkMenuShell and a #GMenuModel.
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 #GtkMenuItem to the menu shell’s item list at the position indicated by position.
Adds a new #GtkMenuItem 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.
Connect to ActivateCurrent signal.
Connect to Cancel signal.
Connect to CycleFocus signal.
Connect to Deactivate signal.
Connect to Insert signal.
Connect to MoveCurrent signal.
Connect to MoveSelected signal.
Connect to SelectionDone signal.
A #GtkMenu is a #GtkMenuShell that implements a drop down menu consisting of a list of #GtkMenuItem objects which can be navigated and activated by the user to perform application functions.
A #GtkMenu is most commonly dropped down by activating a #GtkMenuItem in a #GtkMenuBar or popped up by activating a #GtkMenuItem in another #GtkMenu.
A #GtkMenu can also be popped up by activating a #GtkComboBox. Other composite widgets such as the #GtkNotebook can pop up a #GtkMenu as well.
Applications can display a #GtkMenu as a popup menu by calling the gtk.menu.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
The main CSS node of GtkMenu has name menu, and there are two subnodes with name arrow, for scrolling menu arrows. These subnodes get the .top and .bottom style classes.