set_attribute_value


Description:

public void set_attribute_value (string attribute, Variant? value)

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.

must consist only of lowercase ASCII characters, digits and '-'.

If value is non-null then it is used as the new value for the attribute. If value is null then the attribute is unset. If the value Variant is floating, it is consumed.

See also set_attribute for a more convenient way to do the same.

Parameters:

this

a MenuItem

attribute

the attribute to set

value

a Variant to use as the value, or null