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


1.55 <GMenuLinkIter> ¶

Class: <GMenuLinkIter> ¶

It derives from <GObject>.

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

Fields ¶

parent-instance
priv

Procedures ¶

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

Gets the name of the link at the current iterator position.

The iterator is not advanced.

self

Passed: a <GMenuLinkIter>.

a <GMenuLinkIter>

%return

Returned: a string.

the type of the link

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

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

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

If successful, out-link and value are set to the name and <GMenuModel> of the link that has just been advanced to. At this point, menu-link-iter:get-name and menu-link-iter:get-value will return the same values again.

The value returned in out-link remains valid for as long as the iterator remains at the current position. The value returned in value must be unreffed using object:unref when it is no longer in use.

self

Passed: a <GMenuLinkIter>.

a <GMenuLinkIter>

%return

Returned: a boolean.

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

out-link

Returned: a string.

the name of the link

value

Returned: a <GMenuModel>.

the linked <GMenuModel>

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

Gets the linked <GMenuModel> at the current iterator position.

The iterator is not advanced.

self

Passed: a <GMenuLinkIter>.

a <GMenuLinkIter>

%return

Returned: a <GMenuModel>.

the <GMenuModel> that is linked to

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

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

#t is returned on success, or #f if there are no more links.

You must call this function when you first acquire the iterator to advance it to the first link (and determine if the first link exists at all).

self

Passed: a <GMenuLinkIter>.

a <GMenuLinkIter>

%return

Returned: a boolean.

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

Virtual methods ¶

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

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

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

If successful, out-link and value are set to the name and <GMenuModel> of the link that has just been advanced to. At this point, menu-link-iter:get-name and menu-link-iter:get-value will return the same values again.

The value returned in out-link remains valid for as long as the iterator remains at the current position. The value returned in value must be unreffed using object: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-link value.

implementor

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

self

Passed: a <GMenuLinkIter>.

a <GMenuLinkIter>

%return

Returned: a boolean.

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

out-link

Returned: a string.

the name of the link

value

Returned: a <GMenuModel>.

the linked <GMenuModel>


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