CMenu.Tree¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/co |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Class Details¶
- class CMenu.Tree(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod item_ref(item)¶
- classmethod new(menu_basename, flags)¶
- Parameters:
menu_basename (
str
) – Basename of menu fileflags (
CMenu.TreeFlags
) – Flags controlling menu content
- Returns:
A new
CMenu.Tree
instance- Return type:
- classmethod new_for_path(menu_path, flags)¶
- Parameters:
menu_path (
str
) –flags (
CMenu.TreeFlags
) –
- Return type:
- get_canonical_menu_path()¶
- Returns:
The absolute and canonicalized path to the loaded menu file
- Return type:
This function is only available if the tree has been loaded via
CMenu.Tree.load_sync
() or a variant thereof.
- get_entry_by_id(id)¶
- Parameters:
id (
str
) – a desktop file ID- Returns:
A newly referenced
CMenu.TreeEntry
, orNone
if none- Return type:
Look up the entry corresponding to the given “desktop file id”.
- get_root_directory()¶
- Returns:
Root of the tree
- Return type:
Get the root directory; you must have loaded the tree first (at least once) via
CMenu.Tree.load_sync
() or a variant thereof.
- load_sync()¶
- Raises:
- Returns:
- Return type:
Synchronously load the menu contents. This function performs a significant amount of blocking I/O if the tree has not been loaded yet.
Signal Details¶
- CMenu.Tree.signals.changed(tree)¶
- Signal Name:
changed
- Flags:
- Parameters:
tree (
CMenu.Tree
) – The object which received the signal
Property Details¶
- CMenu.Tree.props.flags¶
- Name:
flags
- Type:
- Default Value:
- Flags:
Flags controlling the content of the menu.
- CMenu.Tree.props.menu_basename¶
- Name:
menu-basename
- Type:
- Default Value:
'applications.menu'
- Flags:
The name of the menu file; must be a basename or a relative path. The file will be looked up in $XDG_CONFIG_DIRS/menus/. See the Desktop Menu specification.
- CMenu.Tree.props.menu_path¶
- Name:
menu-path
- Type:
- Default Value:
- Flags:
The full path of the menu file. If set,
CMenu.Tree
:menu-basename
will get ignored.