### Method

# Gio MenuItem get_attribute

since: 2.34

#### Declaration

    gboolean
    g_menu_item_get_attribute (
      GMenuItem* menu_item,
      const gchar* attribute,
      const gchar* format_string,
      ...
    )

#### Description

Queries the named `attribute` on `menu_item`.

If the attribute exists and matches the `GVariantType` corresponding to `format_string` then `format_string` is used to deconstruct the value into the positional parameters and `TRUE` is returned.

If the attribute does not exist, or it does exist but has the wrong type, then the positional parameters are ignored and `FALSE` is returned.

Available since: 2.34

This method is not directly available to language bindings.

#### Parameters

`attribute`

  Type: `const gchar*`

  The attribute name to query.

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

`format_string`

  Type: `const gchar*`

  A `GVariant` format string.

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

`...`

  Type: ``

  Positional parameters, as per `format_string`.

#### Return value

Type: `gboolean`

`TRUE` if the named attribute was found with the expected type.