Gio.MenuAttributeIter

g GObject.Object GObject.Object Gio.MenuAttributeIter Gio.MenuAttributeIter GObject.Object->Gio.MenuAttributeIter

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.MenuAttributeIter(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Gio.MenuAttributeIterClass

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

New in version 2.32.

get_name()[source]
Returns:

the name of the attribute

Return type:

str

Gets the name of the attribute at the current iterator position, as a string.

The iterator is not advanced.

New in version 2.32.

get_next()[source]
Returns:

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

out_name:

the type of the attribute

value:

the attribute value

Return type:

(bool, out_name: str, value: GLib.Variant)

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

First the iterator is advanced to the next (possibly first) attribute. If that fails, then 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, Gio.MenuAttributeIter.get_name() and 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 GLib.Variant.unref() when it is no longer in use.

New in version 2.32.

get_value()[source]
Returns:

the value of the current attribute

Return type:

GLib.Variant

Gets the value of the attribute 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 attributes

Return type:

bool

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

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

New in version 2.32.

do_get_next() virtual
Returns:

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

out_name:

the type of the attribute

value:

the attribute value

Return type:

(bool, out_name: str, value: GLib.Variant)

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

First the iterator is advanced to the next (possibly first) attribute. If that fails, then 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, Gio.MenuAttributeIter.get_name() and 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 GLib.Variant.unref() when it is no longer in use.

New in version 2.32.