Gio.MenuLinkIter

g GObject.Object GObject.Object Gio.MenuLinkIter Gio.MenuLinkIter GObject.Object->Gio.MenuLinkIter

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_name ()

get_next ()

get_value ()

next ()

Virtual Methods

Inherited:

GObject.Object (7)

do_get_next ()

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Gio.MenuLinkIter(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Gio.MenuLinkIterClass

Gio.MenuLinkIter is an opaque structure type. You must access it using the functions below.

New in version 2.32.

get_name()[source]
Returns:

the type of the link

Return type:

str

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

The iterator is not advanced.

New in version 2.32.

get_next()[source]
Returns:

True on success, or False if there is no additional link

out_link:

the name of the link

value:

the linked Gio.MenuModel

Return type:

(bool, out_link: str, value: Gio.MenuModel)

This function combines Gio.MenuLinkIter.next() with Gio.MenuLinkIter.get_name() and Gio.MenuLinkIter.get_value().

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

If successful, out_link and value are set to the name and Gio.MenuModel of the link that has just been advanced to. At this point, Gio.MenuLinkIter.get_name() and Gio.MenuLinkIter.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 GObject.Object.unref() when it is no longer in use.

New in version 2.32.

get_value()[source]
Returns:

the Gio.MenuModel that is linked to

Return type:

Gio.MenuModel

Gets the linked Gio.MenuModel at the current iterator position.

The iterator is not advanced.

New in version 2.32.

next()[source]
Returns:

True on success, or False when there are no more links

Return type:

bool

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

True is returned on success, or False 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).

New in version 2.32.

do_get_next() virtual
Returns:

True on success, or False if there is no additional link

out_link:

the name of the link

value:

the linked Gio.MenuModel

Return type:

(bool, out_link: str, value: Gio.MenuModel)

This function combines Gio.MenuLinkIter.next() with Gio.MenuLinkIter.get_name() and Gio.MenuLinkIter.get_value().

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

If successful, out_link and value are set to the name and Gio.MenuModel of the link that has just been advanced to. At this point, Gio.MenuLinkIter.get_name() and Gio.MenuLinkIter.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 GObject.Object.unref() when it is no longer in use.

New in version 2.32.