Package: gio

Function gio:menu-item-attribute-value

Lambda List

gio: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 -- an optional expected g:variant-type parameter type or a type string for the the attribute
value -- a g:variant parameter to use as the value, or nil

Details

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

If the vtype argument 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 not 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 parameter is floating, it is consumed.
 

See also

2024-12-30