MateMenu.Tree

g GObject.Object GObject.Object MateMenu.Tree MateMenu.Tree GObject.Object->MateMenu.Tree

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

item_ref (item)

class

item_unref (item)

class

new (menu_basename, flags)

class

new_for_path (menu_path, flags)

get_canonical_menu_path ()

get_directory_from_path (path)

get_entry_by_id (id)

get_root_directory ()

load_sync ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

flags

MateMenu.TreeFlags

r/w/co

menu-basename

str

r/w/co

menu-path

str

r/w/co

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

Fields

Inherited:

GObject.Object (1)

Class Details

class MateMenu.Tree(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

MateMenu.TreeClass

classmethod item_ref(item)
Parameters:

item (object or None) – a #MateMenuTreeItem

Returns:

The same item, or None if item is not a valid #MateMenuTreeItem

Return type:

object or None

classmethod item_unref(item)
Parameters:

item (object or None) –

classmethod new(menu_basename, flags)
Parameters:
  • menu_basename (str) – Basename of menu file

  • flags (MateMenu.TreeFlags) – Flags controlling menu content

Returns:

A new MateMenu.Tree instance

Return type:

MateMenu.Tree

classmethod new_for_path(menu_path, flags)
Parameters:
Return type:

MateMenu.Tree

get_canonical_menu_path()
Returns:

The absolute and canonicalized path to the loaded menu file

Return type:

str

This function is only available if the tree has been loaded via MateMenu.Tree.load_sync() or a variant thereof.

get_directory_from_path(path)
Parameters:

path (str) –

Return type:

MateMenu.TreeDirectory

get_entry_by_id(id)
Parameters:

id (str) – a desktop file ID

Returns:

A newly referenced MateMenu.TreeEntry, or None if none

Return type:

MateMenu.TreeEntry

Look up the entry corresponding to the given “desktop file id”.

get_root_directory()
Returns:

Root of the tree

Return type:

MateMenu.TreeDirectory

Get the root directory; you must have loaded the tree first (at least once) via MateMenu.Tree.load_sync() or a variant thereof.

load_sync()
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

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

MateMenu.Tree.signals.changed(tree)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

tree (MateMenu.Tree) – The object which received the signal

Property Details

MateMenu.Tree.props.flags
Name:

flags

Type:

MateMenu.TreeFlags

Default Value:

MateMenu.TreeFlags.NONE

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Flags controlling the content of the menu.

MateMenu.Tree.props.menu_basename
Name:

menu-basename

Type:

str

Default Value:

'applications.menu'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

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.

MateMenu.Tree.props.menu_path
Name:

menu-path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The full path of the menu file. If set, MateMenu.Tree :menu-basename will get ignored.