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(GtkMenuBar* gtkMenuBar, bool ownedRef)

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

this
this()

Creates a new #GtkMenuBar

this
this(MenuModel model)

Creates a new #GtkMenuBar 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 gtk_menu_bar_set_child_pack_direction().

getMenuBarStruct
GtkMenuBar* getMenuBarStruct()

Get the main Gtk struct

getPackDirection
GtkPackDirection getPackDirection()

Retrieves the current pack direction of the menubar. See gtk_menu_bar_set_pack_direction().

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.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

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

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
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 #GtkMenuItem to the end of the menu shell's item list.

bindModel
void bindModel(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
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 #GtkMenuItem to the menu shell’s item list at the position indicated by @position.

prepend
void prepend(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(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.

OnActivateCurrentDelegateWrapper
class OnActivateCurrentDelegateWrapper
Undocumented in source.
onActivateCurrentListeners
OnActivateCurrentDelegateWrapper[] onActivateCurrentListeners;
Undocumented in source.
addOnActivateCurrent
gulong addOnActivateCurrent(void delegate(bool, MenuShell) dlg, ConnectFlags connectFlags)

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

callBackActivateCurrent
void callBackActivateCurrent(GtkMenuShell* menushellStruct, bool forceHide, OnActivateCurrentDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackActivateCurrentDestroy
void callBackActivateCurrentDestroy(OnActivateCurrentDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnActivateCurrent
void internalRemoveOnActivateCurrent(OnActivateCurrentDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnCancelDelegateWrapper
class OnCancelDelegateWrapper
Undocumented in source.
onCancelListeners
OnCancelDelegateWrapper[] onCancelListeners;
Undocumented in source.
addOnCancel
gulong addOnCancel(void delegate(MenuShell) dlg, ConnectFlags connectFlags)

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

callBackCancel
void callBackCancel(GtkMenuShell* menushellStruct, OnCancelDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackCancelDestroy
void callBackCancelDestroy(OnCancelDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnCancel
void internalRemoveOnCancel(OnCancelDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnCycleFocusDelegateWrapper
class OnCycleFocusDelegateWrapper
Undocumented in source.
onCycleFocusListeners
OnCycleFocusDelegateWrapper[] onCycleFocusListeners;
Undocumented in source.
addOnCycleFocus
gulong addOnCycleFocus(void delegate(GtkDirectionType, MenuShell) dlg, ConnectFlags connectFlags)

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

callBackCycleFocus
void callBackCycleFocus(GtkMenuShell* menushellStruct, GtkDirectionType direction, OnCycleFocusDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackCycleFocusDestroy
void callBackCycleFocusDestroy(OnCycleFocusDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnCycleFocus
void internalRemoveOnCycleFocus(OnCycleFocusDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnDeactivateDelegateWrapper
class OnDeactivateDelegateWrapper
Undocumented in source.
onDeactivateListeners
OnDeactivateDelegateWrapper[] onDeactivateListeners;
Undocumented in source.
addOnDeactivate
gulong addOnDeactivate(void delegate(MenuShell) dlg, ConnectFlags connectFlags)

This signal is emitted when a menu shell is deactivated.

callBackDeactivate
void callBackDeactivate(GtkMenuShell* menushellStruct, OnDeactivateDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackDeactivateDestroy
void callBackDeactivateDestroy(OnDeactivateDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnDeactivate
void internalRemoveOnDeactivate(OnDeactivateDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnInsertDelegateWrapper
class OnInsertDelegateWrapper
Undocumented in source.
onInsertListeners
OnInsertDelegateWrapper[] onInsertListeners;
Undocumented in source.
addOnInsert
gulong addOnInsert(void delegate(Widget, int, MenuShell) dlg, ConnectFlags connectFlags)

The ::insert signal is emitted when a new #GtkMenuItem is added to a #GtkMenuShell. A separate signal is used instead of GtkContainer::add because of the need for an additional position parameter.

callBackInsert
void callBackInsert(GtkMenuShell* menushellStruct, GtkWidget* child, int position, OnInsertDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackInsertDestroy
void callBackInsertDestroy(OnInsertDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnInsert
void internalRemoveOnInsert(OnInsertDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnMoveCurrentDelegateWrapper
class OnMoveCurrentDelegateWrapper
Undocumented in source.
onMoveCurrentListeners
OnMoveCurrentDelegateWrapper[] onMoveCurrentListeners;
Undocumented in source.
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.

callBackMoveCurrent
void callBackMoveCurrent(GtkMenuShell* menushellStruct, GtkMenuDirectionType direction, OnMoveCurrentDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackMoveCurrentDestroy
void callBackMoveCurrentDestroy(OnMoveCurrentDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnMoveCurrent
void internalRemoveOnMoveCurrent(OnMoveCurrentDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnMoveSelectedDelegateWrapper
class OnMoveSelectedDelegateWrapper
Undocumented in source.
onMoveSelectedListeners
OnMoveSelectedDelegateWrapper[] onMoveSelectedListeners;
Undocumented in source.
addOnMoveSelected
gulong addOnMoveSelected(bool delegate(int, MenuShell) dlg, ConnectFlags connectFlags)

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

callBackMoveSelected
int callBackMoveSelected(GtkMenuShell* menushellStruct, int distance, OnMoveSelectedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackMoveSelectedDestroy
void callBackMoveSelectedDestroy(OnMoveSelectedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnMoveSelected
void internalRemoveOnMoveSelected(OnMoveSelectedDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnSelectionDoneDelegateWrapper
class OnSelectionDoneDelegateWrapper
Undocumented in source.
onSelectionDoneListeners
OnSelectionDoneDelegateWrapper[] onSelectionDoneListeners;
Undocumented in source.
addOnSelectionDone
gulong addOnSelectionDone(void delegate(MenuShell) dlg, ConnectFlags connectFlags)

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

callBackSelectionDone
void callBackSelectionDone(GtkMenuShell* menushellStruct, OnSelectionDoneDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackSelectionDoneDestroy
void callBackSelectionDoneDestroy(OnSelectionDoneDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnSelectionDone
void internalRemoveOnSelectionDone(OnSelectionDoneDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta