Next: <GMenuItem>, Previous: <GMenu>, Up: Classes   [Index]


1.53 <GMenuAttributeIter> ¶

Class: <GMenuAttributeIter> ¶

It derives from <GObject>.

<GMenuAttributeIter> is an opaque structure type. You must access it using the functions below.

Fields ¶

parent-instance
priv

Procedures ¶

Method: menu-attribute-iter:get-name self ⇒ %return ¶
Method: get-name self ⇒ %return ¶

Gets the name of the attribute at the current iterator position, as a string.

The iterator is not advanced.

self

Passed: a <GMenuAttributeIter>.

a <GMenuAttributeIter>

%return

Returned: a string.

the name of the attribute

Method: menu-attribute-iter:get-next self ⇒ %return out-name value ¶
Method: get-next self ⇒ %return out-name value ¶

This function combines menu-attribute-iter:next? with menu-attribute-iter:get-name and menu-attribute-iter:get-value.

First the iterator is advanced to the next (possibly first) attribute. If that fails, then #f is returned and there are no other effects.

If successful, name and value are set to the name and value of the attribute that has just been advanced to. At this point, menu-attribute-iter:get-name and menu-attribute-iter:get-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 in value must be unreffed using variant:unref when it is no longer in use.

self

Passed: a <GMenuAttributeIter>.

a <GMenuAttributeIter>

%return

Returned: a boolean.

#t on success, or #f if there is no additional attribute

out-name

Returned: a string.

the type of the attribute

value

Returned: a <GVariant>.

the attribute value

Method: menu-attribute-iter:get-value self ⇒ %return ¶
Method: get-value self ⇒ %return ¶

Gets the value of the attribute at the current iterator position.

The iterator is not advanced.

self

Passed: a <GMenuAttributeIter>.

a <GMenuAttributeIter>

%return

Returned: a <GVariant>.

the value of the current attribute

Method: menu-attribute-iter:next? self ⇒ %return ¶
Method: next? self ⇒ %return ¶

Attempts to advance the iterator to the next (possibly first) attribute.

#t is returned on success, or #f 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).

self

Passed: a <GMenuAttributeIter>.

a <GMenuAttributeIter>

%return

Returned: a boolean.

#t on success, or #f when there are no more attributes

Virtual methods ¶

Virtual method: menu-attribute-iter:do-get-next implementor self ⇒ %return out-name value ¶

This function combines menu-attribute-iter:next? with menu-attribute-iter:get-name and menu-attribute-iter:get-value.

First the iterator is advanced to the next (possibly first) attribute. If that fails, then #f is returned and there are no other effects.

If successful, name and value are set to the name and value of the attribute that has just been advanced to. At this point, menu-attribute-iter:get-name and menu-attribute-iter:get-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 in value must be unreffed using variant:unref when it is no longer in use.

To override it in a new class, give register-type #:vfuncs `((get-next . ,procedure)). The procedure is called as (procedure self) ⇒ %return out-name value.

implementor

Passed: the class whose implementation to call: <GMenuAttributeIter>, or a class that derives from it, or its GType number.

self

Passed: a <GMenuAttributeIter>.

a <GMenuAttributeIter>

%return

Returned: a boolean.

#t on success, or #f if there is no additional attribute

out-name

Returned: a string.

the type of the attribute

value

Returned: a <GVariant>.

the attribute value


Next: <GMenuItem>, Previous: <GMenu>, Up: Classes   [Index]