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


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


item_index gint

The index of the item.

attribute 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 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

Returns: GVariant

The value of the attribute.

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