Dazzle.MenuManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Dazzle.MenuManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The goal of
Dazzle.MenuManager
is to simplify the process of merging multipleGtk.Builder
.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
Gio.Menu
instances created by aGtk.Builder
instance. Instead, we create the menus ourself and recreate section and submenu links. This allows theDazzle.MenuManager
to be in full control of the generated menus.Dazzle.MenuManager.get_menu_by_id
() will always return aGio.Menu
, however that menu may contain no children until something has extended it later on during the application process.New in version 3.26.
- classmethod new()¶
- Return type:
- merge(menu_id, model)¶
- Parameters:
menu_id (
str
) –model (
Gio.MenuModel
) –
- Return type:
- remove(merge_id)¶
- Parameters:
merge_id (
int
) – A previously registered merge id
This removes items from menus that were added as part of a previous menu merge. Use the value returned from
Dazzle.MenuManager.merge
() as the merge_id.New in version 3.26.