Method

GioMenuItemset_attribute

Declaration

void
g_menu_item_set_attribute (
  GMenuItem* menu_item,
  const gchar* attribute,
  const gchar* format_string,
  ...
)

Description

Sets or unsets an attribute on menu_item.

The attribute to set or unset is specified by attribute. This can be one of the standard attribute names G_MENU_ATTRIBUTE_LABEL, G_MENU_ATTRIBUTE_ACTION, G_MENU_ATTRIBUTE_TARGET, or a custom attribute name. Attribute names are restricted to lowercase characters, numbers and ‘-‘. Furthermore, the names must begin with a lowercase character, must not end with a ‘-‘, and must not contain consecutive dashes.

If format_string is non-NULL then the proper position parameters are collected to create a GVariant instance to use as the attribute value. If it is NULL then the positional parameterrs are ignored and the named attribute is unset.

See also g_menu_item_set_attribute_value() for an equivalent call that directly accepts a GVariant.

Available since:2.32
This method is not directly available to language bindings.

Parameters

attribute const gchar*
 

The attribute to set.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
format_string const gchar*
 

A GVariant format string, or NULL.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
...
 

Positional parameters, as per format_string.