Gio.MenuModel.get_item_attribute_value

### Method

# Gio MenuModelget_item_attribute_value

since: 2.32

#### Declaration [src]

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

#### Description [src]

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 method.
  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 method.

#### Return value

Type: `GVariant`

The value of the attribute.

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