panel.menu_manager

Module for [MenuManager] class

Types 3

The goal of #PanelMenuManager is to simplify the process of merging multiple GtkBuilder .ui files containing menus into a single representation of the application menus. Additionally, it provides the ability to "unmerge" previously merged menus.

This allows for an application to have plugins which seemlessly extends the core application menus.

Implementation notes:

To make this work, we don't use the GMenu instances created by a GtkBuilder instance. Instead, we create the menus ourself and recreate section and submenu links. This allows the #PanelMenuManager to be in full control of the generated menus.

panel.menu_manager.MenuManager.getMenuById will always return a #GMenu, however that menu may contain no children until something has extended it later on during the application process.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
MenuManager self() nothrowReturns `this`, for use in `with` statements.
MenuManagerGidBuilder builder() static nothrowGet builder for [panel.menu_manager.MenuManager] Returns: New builder object
uint addFilename(string filename)
uint addResource(string resource)
gio.menu.Menu findItemById(string id, out uint position) nothrowLocates a menu item that matches id and sets the position within the resulting #GMenu to position.
gio.menu.Menu getMenuById(string menuId) nothrow
string[] getMenuIds() nothrowGets the known menu ids as a string array. Returns:
uint merge(string menuId, gio.menu_model.MenuModel menuModel) nothrowNote that menu_model is not retained, a copy of it is made.
void remove(uint mergeId) nothrowThis removes items from menus that were added as part of a previous menu merge. Use the value returned from [panel.menu_manager.MenuManager.merge] as the merge_id.
void setAttributeString(gio.menu.Menu menu, uint position, string attribute, string value) nothrowOverwrites an attribute for a menu that was created by #PanelMenuManager.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
MenuManager build() nothrowCreate object from builder. Returns: New object