Gio.MenuModel.get_item_attribute_value
Description: Reference for Gio.MenuModel.get_item_attribute_value

### Virtual Method

# Gio MenuModelget_item_attribute_value

since: 2.32

#### Declaration

    GVariant*
    get_item_attribute_value (
      GMenuModel* model,
      gint item_index,
      const gchar* attribute,
      const GVariantType* expected_type
    )

#### Description

Queries the item at position `item_index` in `model` for the attribute specified by `attribute`.

If `expected_type` is non-`NULL` then it specifies the expected type of the attribute. If it is `NULL` then any type will be accepted.

If the attribute exists and matches `expected_type` (or if the expected type is unspecified) then the value is returned.

If the attribute does not exist, or does not match the expected type then `NULL` is returned.

Available since: 2.32

#### Parameters

`item_index`

  Type: `gint`

  The index of the item.

`attribute`

  Type: `const gchar*`

  The attribute 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, or `NULL`.

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

#### Return value

Type: `GVariant`

The value of the attribute.

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