MenuAttributeIter
Added in version 2.32.
Superclasses: Object
MenuAttributeIter
is an opaque structure type. You must access it
using the functions below.
Methods
- class MenuAttributeIter
- get_name() → str
Gets the name of the attribute at the current iterator position, as a string.
The iterator is not advanced.
Added in version 2.32.
- get_next() → tuple[bool, str, Variant]
This function combines
next()
withget_name()
andget_value()
.First the iterator is advanced to the next (possibly first) attribute. If that fails, then
False
is returned and there are no other effects.If successful,
name
andvalue
are set to the name and value of the attribute that has just been advanced to. At this point,get_name()
andget_value()
will return the same values again.The value returned in
name
remains valid for as long as the iterator remains at the current position. The value returned invalue
must be unreffed usingunref()
when it is no longer in use.Added in version 2.32.
- get_value() → Variant
Gets the value of the attribute at the current iterator position.
The iterator is not advanced.
Added in version 2.32.
- next() → bool
Attempts to advance the iterator to the next (possibly first) attribute.
True
is returned on success, orFalse
if there are no more attributes.You must call this function when you first acquire the iterator to advance it to the first attribute (and determine if the first attribute exists at all).
Added in version 2.32.
Virtual Methods
- class MenuAttributeIter
- do_get_next() → tuple[bool, str, Variant]
This function combines
next()
withget_name()
andget_value()
.First the iterator is advanced to the next (possibly first) attribute. If that fails, then
False
is returned and there are no other effects.If successful,
name
andvalue
are set to the name and value of the attribute that has just been advanced to. At this point,get_name()
andget_value()
will return the same values again.The value returned in
name
remains valid for as long as the iterator remains at the current position. The value returned invalue
must be unreffed usingunref()
when it is no longer in use.Added in version 2.32.