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