DBusConnection.exportMenuModel

uint exportMenuModel(string objectPath, gio.menu_model.MenuModel menu)

Exports menu on connection at object_path.

The implemented D-Bus API should be considered private. It is subject to change in the future.

An object path can only have one menu model exported on it. If this constraint is violated, the export will fail and 0 will be returned (with error set accordingly).

Exporting menus with sections containing more than [gio.types.MENU_EXPORTER_MAX_SECTION_SIZE] items is not supported and results in undefined behavior.

You can unexport the menu model using [gio.dbus_connection.DBusConnection.unexportMenuModel] with the return value of this function.

Parameters

objectPatha D-Bus object path
menua #GMenuModel

Returns

the ID of the export (never zero), or 0 in case of failure

Throws

[ErrorWrap]