Skip to content

Gio.MenuLinkIter

class — extends GObject.Object

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

Methods

get_name

def get_name(self) -> str

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

The iterator is not advanced.

get_next

def get_next(self) -> tuple[bool, str, MenuModel]

This function combines MenuLinkIter.next with MenuLinkIter.get_name and 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 MenuModel of the link that has just been advanced to. At this point, MenuLinkIter.get_name and 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.

get_value

def get_value(self) -> MenuModel

Gets the linked MenuModel at the current iterator position.

The iterator is not advanced.

next

def next(self) -> 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).

Virtual methods

do_get_next

def do_get_next(self) -> tuple[bool, str, MenuModel]

This function combines MenuLinkIter.next with MenuLinkIter.get_name and 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 MenuModel of the link that has just been advanced to. At this point, MenuLinkIter.get_name and 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.