Method

GioMenuItemget_attribute_value

since: 2.34

Declaration

GVariant*
g_menu_item_get_attribute_value (
  GMenuItem* menu_item,
  const gchar* attribute,
  const GVariantType* expected_type
)

Description

Queries the named attribute on menu_item.

If expected_type is specified and the attribute does not have this type, NULL is returned. NULL is also returned if the attribute simply does not exist.

Available since: 2.34

Parameters

attribute

Type: const gchar*

The attribute name to query.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
expected_type

Type: GVariantType

The expected type of the attribute.

The argument can be NULL.
The data is owned by the caller of the function.

Return value

Type: GVariant

The attribute value, or NULL.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The return value can be NULL.