set_attribute


Description:

public void set_attribute (string attribute, string? format_string, ...)

Sets or unsets an attribute on this.

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 Variant 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 set_attribute_value for an equivalent call that directly accepts a Variant.

Parameters:

this

a MenuItem

attribute

the attribute to set

format_string

a Variant format string, or null

...

positional parameters, as per format_string