:right-sidebar: True MenuLinkIter =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.32 .. class:: MenuLinkIter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` :obj:`~gi.repository.Gio.MenuLinkIter` is an opaque structure type. You must access it using the functions below. Methods ------- .. rst-class:: interim-class .. class:: MenuLinkIter :no-index: .. method:: do_get_next(self) -> ~typing.Tuple[bool, str, ~gi.repository.Gio.MenuModel] .. method:: get_name() -> str Gets the name of the link at the current iterator position. The iterator is not advanced. .. versionadded:: 2.32 .. method:: get_next() -> ~typing.Tuple[bool, str, ~gi.repository.Gio.MenuModel] This function combines :func:`~gi.repository.Gio.MenuLinkIter.next` with :func:`~gi.repository.Gio.MenuLinkIter.get_name` and :func:`~gi.repository.Gio.MenuLinkIter.get_value`. First the iterator is advanced to the next (possibly first) link. If that fails, then :const:`False` is returned and there are no other effects. If successful, ``out_link`` and ``value`` are set to the name and :obj:`~gi.repository.Gio.MenuModel` of the link that has just been advanced to. At this point, :func:`~gi.repository.Gio.MenuLinkIter.get_name` and :func:`~gi.repository.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 :func:`~gi.repository.GObject.GObject.Object.unref` when it is no longer in use. .. versionadded:: 2.32 .. method:: get_value() -> ~gi.repository.Gio.MenuModel Gets the linked :obj:`~gi.repository.Gio.MenuModel` at the current iterator position. The iterator is not advanced. .. versionadded:: 2.32 .. method:: next() -> bool Attempts to advance the iterator to the next (possibly first) link. :const:`True` is returned on success, or :const:`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). .. versionadded:: 2.32 Virtual Methods --------------- .. rst-class:: interim-class .. class:: MenuLinkIter :no-index: .. method:: do_get_next() -> ~typing.Tuple[bool, str, ~gi.repository.Gio.MenuModel] This function combines :func:`~gi.repository.Gio.MenuLinkIter.next` with :func:`~gi.repository.Gio.MenuLinkIter.get_name` and :func:`~gi.repository.Gio.MenuLinkIter.get_value`. First the iterator is advanced to the next (possibly first) link. If that fails, then :const:`False` is returned and there are no other effects. If successful, ``out_link`` and ``value`` are set to the name and :obj:`~gi.repository.Gio.MenuModel` of the link that has just been advanced to. At this point, :func:`~gi.repository.Gio.MenuLinkIter.get_name` and :func:`~gi.repository.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 :func:`~gi.repository.GObject.GObject.Object.unref` when it is no longer in use. .. versionadded:: 2.32 Fields ------ .. rst-class:: interim-class .. class:: MenuLinkIter :no-index: .. attribute:: parent_instance .. attribute:: priv