Top | ![]() |
![]() |
![]() |
![]() |
guint dzl_menu_manager_add_filename (DzlMenuManager *self
,const gchar *filename
,GError **error
);
guint dzl_menu_manager_add_resource (DzlMenuManager *self
,const gchar *resource
,GError **error
);
guint dzl_menu_manager_merge (DzlMenuManager *self
,const gchar *menu_id
,GMenuModel *model
);
void dzl_menu_manager_remove (DzlMenuManager *self
,guint merge_id
);
This removes items from menus that were added as part of a previous
menu merge. Use the value returned from dzl_menu_manager_merge()
as
the merge_id
.
Since: 3.26
GMenu * dzl_menu_manager_get_menu_by_id (DzlMenuManager *self
,const gchar *menu_id
);
typedef struct _DzlMenuManager DzlMenuManager;
The goal of DzlMenuManager 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 DzlMenuManager to be in full control of the generated menus.
dzl_menu_manager_get_menu_by_id() will always return a GMenu, however that menu may contain no children until something has extended it later on during the application process.
Since: 3.26