Package: gio

Function g-menu-item-attribute-value

Lambda List

g-menu-item-attribute-value (item attribute &optional vtype)

Syntax

(g-menu-item-attribute-value item attribute) => value
(g-menu-item-attribute-value item attribute vtype) => value
(setf (g-menu-item-attribute-value item attribute) value)

Arguments

item -- a g-menu-item object
attribute -- a string with the attribute name
vtype -- the optional expected g-variant-type type or a type string of the attribute
value -- a g-variant value to use as the value, or nil

Details

The function g-menu-item-attribute-value queries the named attribute on the menu item. The function (setf g-menu-item-attribute-value) sets or unsets an attribute.

If the argument vtype is specified and the attribute does not have this type, nil is returned. Nil is also returned if the attribute simply does not exist.

The attribute to set or unset is specified by attribute. This can be one of the standard attribute names "label", "action", "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 value is non-nil then it is used as the new value for the attribute. If value is nil then the attribute is unset. If the g-variant value is floating, it is consumed.
 

See also

2021-8-17