gtk.menu_shell

Module for [MenuShell] class

Types 3

A #GtkMenuShell is the abstract base class used to derive the #GtkMenu and #GtkMenuBar subclasses.

A #GtkMenuShell is a container of #GtkMenuItem objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A #GtkMenuItem can have a submenu associated with it, allowing for nested hierarchical menus.

Terminology

A menu item can be “selected”, this means that it is displayed in the prelight state, and if it has a submenu, that submenu will be popped up.

A menu is “active” when it is visible onscreen and the user is selecting from it. A menubar is not active until the user clicks on one of its menuitems. When a menu is active, passing the mouse over a submenu will pop it up.

There is also is a concept of the current menu and a current menu item. The current menu item is the selected menu item that is furthest down in the hierarchy. (Every active menu shell does not necessarily contain a selected menu item, but if it does, then the parent menu shell must also contain a selected menu item.) The current menu is the menu that contains the current menu item. It will always have a GTK grab and receive all key presses.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
MenuShell self() nothrowReturns `this`, for use in `with` statements.
MenuShellGidBuilder builder() static nothrowGet builder for [gtk.menu_shell.MenuShell] Returns: New builder object
bool takeFocus() @property nothrowGet `takeFocus` property. Returns: A boolean that determines whether the menu and its submenus grab the keyboard focus. See [gtk.menu_shell.MenuShell.setTakeFocus] and [gtk.menu_shell.MenuShell.get...
void takeFocus(bool propval) @property nothrowSet `takeFocus` property. Params: propval = A boolean that determines whether the menu and its submenus grab the keyboard focus. See [gtk.menu_shell.MenuShell.setTakeFocus] and [gtk.menu_shell.Menu...
void activateItem(gtk.widget.Widget menuItem, bool forceDeactivate) nothrowActivates the menu item within the menu shell.
void append(gtk.menu_item.MenuItem child) nothrowAdds a new #GtkMenuItem to the end of the menu shell's item list.
void bindModel(gio.menu_model.MenuModel model, string actionNamespace, bool withSeparators) nothrowEstablishes a binding between a #GtkMenuShell and a #GMenuModel.
void cancel() nothrowCancels the selection within the menu shell.
void deactivate() nothrowDeactivates the menu shell.
void deselect() nothrowDeselects the currently selected item from the menu shell, if any.
gtk.widget.Widget getParentShell() nothrowGets the parent menu shell.
gtk.widget.Widget getSelectedItem() nothrowGets the currently selected item. Returns: the currently selected item
bool getTakeFocus() nothrowReturns true if the menu shell will take the keyboard focus on popup. Returns: true if the menu shell will take the keyboard focus on popup.
void insert(gtk.widget.Widget child, int position) nothrowAdds a new #GtkMenuItem to the menu shell’s item list at the position indicated by position.
void prepend(gtk.widget.Widget child) nothrowAdds a new #GtkMenuItem to the beginning of the menu shell's item list.
void selectFirst(bool searchSensitive) nothrowSelect the first visible or selectable child of the menu shell; don’t select tearoff items unless the only item is a tearoff item.
void selectItem(gtk.widget.Widget menuItem) nothrowSelects the menu item from the menu shell.
void setTakeFocus(bool takeFocus) nothrowIf 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.
gulong connectActivateCurrent(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == bool))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 3) nothrowConnect to `ActivateCurrent` signal.
gulong connectCancel(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 2) nothrowConnect to `Cancel` signal.
gulong connectCycleFocus(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.types.DirectionType))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 3) nothrowConnect to `CycleFocus` signal.
gulong connectDeactivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 2) nothrowConnect to `Deactivate` signal.
gulong connectInsert(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.widget.Widget))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == int))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 4) nothrowConnect to `Insert` signal.
gulong connectMoveCurrent(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.types.MenuDirectionType))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 3) nothrowConnect to `MoveCurrent` signal.
gulong connectMoveSelected(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == int))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 3) nothrowConnect to `MoveSelected` signal.
gulong connectSelectionDone(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.menu_shell.MenuShell))) && Parameters!T.length < 2) nothrowConnect to `SelectionDone` signal.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gtk.menu_shell.MenuShell

Methods
T takeFocus(bool propval) nothrowSet `takeFocus` property. Params: propval = A boolean that determines whether the menu and its submenus grab the keyboard focus. See [gtk.menu_shell.MenuShell.setTakeFocus] and [gtk.menu_shell.Menu...

Fluent builder for gtk.menu_shell.MenuShell

Methods
MenuShell build() nothrowCreate object from builder. Returns: New object