MenuBar

The #GtkMenuBar is a subclass of #GtkMenuShell which contains one or more #GtkMenuItems. The result is a standard menu bar which can hold many menu items.

CSS nodes

GtkMenuBar has a single CSS node with name menubar.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GtkMenuBar

Members

Functions

getChildPackDirection
gtk.types.PackDirection getChildPackDirection()

Retrieves the current child pack direction of the menubar. See gtk.menu_bar.MenuBar.setChildPackDirection.

getPackDirection
gtk.types.PackDirection getPackDirection()

Retrieves the current pack direction of the menubar. See gtk.menu_bar.MenuBar.setPackDirection.

self
MenuBar self()

Returns this, for use in with statements.

setChildPackDirection
void setChildPackDirection(gtk.types.PackDirection childPackDir)

Sets how widgets should be packed inside the children of a menubar.

setPackDirection
void setPackDirection(gtk.types.PackDirection packDir)

Sets how items should be packed inside a menubar.

Properties

_gType
GType _gType [@property getter]
childPackDirection
gtk.types.PackDirection childPackDirection [@property getter]

Get childPackDirection property.

childPackDirection
gtk.types.PackDirection childPackDirection [@property setter]

Set childPackDirection property.

packDirection
gtk.types.PackDirection packDirection [@property getter]

Get packDirection property.

packDirection
gtk.types.PackDirection packDirection [@property setter]

Set packDirection property.

Static functions

_getGType
GType _getGType()
builder
MenuBarGidBuilder builder()

Get builder for gtk.menu_bar.MenuBar

newFromModel
gtk.menu_bar.MenuBar newFromModel(gio.menu_model.MenuModel model)

Creates a new #GtkMenuBar and populates it with menu items and submenus according to model.

Inherited Members

From MenuShell

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
MenuShell self()

Returns this, for use in with statements.

builder
MenuShellGidBuilder builder()

Get builder for gtk.menu_shell.MenuShell

takeFocus
bool takeFocus [@property getter]

Get takeFocus property.

takeFocus
bool takeFocus [@property setter]

Set takeFocus property.

activateItem
void activateItem(gtk.widget.Widget menuItem, bool forceDeactivate)

Activates the menu item within the menu shell.

append
void append(gtk.menu_item.MenuItem child)

Adds a new #GtkMenuItem to the end of the menu shell's item list.

bindModel
void bindModel(gio.menu_model.MenuModel model, string actionNamespace, bool withSeparators)

Establishes a binding between a #GtkMenuShell and a #GMenuModel.

cancel
void cancel()

Cancels the selection within the menu shell.

deactivate
void deactivate()

Deactivates the menu shell.

deselect
void deselect()

Deselects the currently selected item from the menu shell, if any.

getParentShell
gtk.widget.Widget getParentShell()

Gets the parent menu shell.

getSelectedItem
gtk.widget.Widget getSelectedItem()

Gets the currently selected item.

getTakeFocus
bool getTakeFocus()

Returns true if the menu shell will take the keyboard focus on popup.

insert
void insert(gtk.widget.Widget child, int position)

Adds a new #GtkMenuItem to the menu shell’s item list at the position indicated by position.

prepend
void prepend(gtk.widget.Widget child)

Adds a new #GtkMenuItem to the beginning of the menu shell's item list.

selectFirst
void selectFirst(bool searchSensitive)

Select the first visible or selectable child of the menu shell; don’t select tearoff items unless the only item is a tearoff item.

selectItem
void selectItem(gtk.widget.Widget menuItem)

Selects the menu item from the menu shell.

setTakeFocus
void setTakeFocus(bool takeFocus)

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.

connectActivateCurrent
gulong connectActivateCurrent(T callback, Flag!"After" after)

Connect to ActivateCurrent signal.

connectCancel
gulong connectCancel(T callback, Flag!"After" after)

Connect to Cancel signal.

connectCycleFocus
gulong connectCycleFocus(T callback, Flag!"After" after)

Connect to CycleFocus signal.

connectDeactivate
gulong connectDeactivate(T callback, Flag!"After" after)

Connect to Deactivate signal.

connectInsert
gulong connectInsert(T callback, Flag!"After" after)

Connect to Insert signal.

connectMoveCurrent
gulong connectMoveCurrent(T callback, Flag!"After" after)

Connect to MoveCurrent signal.

connectMoveSelected
gulong connectMoveSelected(T callback, Flag!"After" after)

Connect to MoveSelected signal.

connectSelectionDone
gulong connectSelectionDone(T callback, Flag!"After" after)

Connect to SelectionDone signal.