MenuBar

The gtk.MenuBar is a subclass of gtk.MenuShell which contains one or more gtk.MenuItems 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(GtkMenuBar* gtkMenuBar, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new gtk.MenuBar

this
this(MenuModel model)

Creates a new gtk.MenuBar and populates it with menu items and submenus according to model.

Members

Functions

append
Menu append(string label, bool rightJustify)
append
void append(MenuItem item)
getChildPackDirection
GtkPackDirection getChildPackDirection()

Retrieves the current child pack direction of the menubar. See Menu.barSetChildPackDirection.

getMenuBarStruct
GtkMenuBar* getMenuBarStruct(bool transferOwnership)

Get the main Gtk struct

getPackDirection
GtkPackDirection getPackDirection()

Retrieves the current pack direction of the menubar. See Menu.barSetPackDirection.

getStruct
void* getStruct()

the main Gtk struct as a void*

setChildPackDirection
void setChildPackDirection(GtkPackDirection childPackDir)

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

setPackDirection
void setPackDirection(GtkPackDirection packDir)

Sets how items should be packed inside a menubar.

Static functions

getType
GType getType()

Variables

gtkMenuBar
GtkMenuBar* gtkMenuBar;

the main Gtk struct

Inherited Members

From MenuShell

gtkMenuShell
GtkMenuShell* gtkMenuShell;

the main Gtk struct

getMenuShellStruct
GtkMenuShell* getMenuShellStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
activateItem
void activateItem(Widget menuItem, bool forceDeactivate)

Activates the menu item within the menu shell.

append
void append(MenuItem child)

Adds a new gtk.MenuItem to the end of the menu shell's item list.

bindModel
void bindModel(MenuModel model, string actionNamespace, bool withSeparators)

Establishes a binding between a gtk.MenuShell and a gio.MenuModel

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
Widget getParentShell()

Gets the parent menu shell.

getSelectedItem
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(Widget child, int position)

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

prepend
void prepend(Widget child)

Adds a new gtk.MenuItem 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(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.

addOnActivateCurrent
gulong addOnActivateCurrent(void delegate(bool, MenuShell) dlg, ConnectFlags connectFlags)

An action signal that activates the current menu item within the menu shell.

addOnCancel
gulong addOnCancel(void delegate(MenuShell) dlg, ConnectFlags connectFlags)

An action signal which cancels the selection within the menu shell. Causes the selection-done signal to be emitted.

addOnCycleFocus
gulong addOnCycleFocus(void delegate(GtkDirectionType, MenuShell) dlg, ConnectFlags connectFlags)

A keybinding signal which moves the focus in the given direction.

addOnDeactivate
gulong addOnDeactivate(void delegate(MenuShell) dlg, ConnectFlags connectFlags)

This signal is emitted when a menu shell is deactivated.

addOnInsert
gulong addOnInsert(void delegate(Widget, int, MenuShell) dlg, ConnectFlags connectFlags)

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.

addOnMoveCurrent
gulong addOnMoveCurrent(void delegate(GtkMenuDirectionType, MenuShell) dlg, ConnectFlags connectFlags)

An keybinding signal which moves the current menu item in the direction specified by direction.

addOnMoveSelected
gulong addOnMoveSelected(bool delegate(int, MenuShell) dlg, ConnectFlags connectFlags)

The ::move-selected signal is emitted to move the selection to another item.

addOnSelectionDone
gulong addOnSelectionDone(void delegate(MenuShell) dlg, ConnectFlags connectFlags)

This signal is emitted when a selection has been completed within a menu shell.