Gtk.BitsetIter

Fields

Name

Type

Access

Description

private_data

[object]

r

Methods

class

init_at (set, target)

class

init_first (set)

class

init_last (set)

get_value ()

is_valid ()

next ()

previous ()

Details

class Gtk.BitsetIter

An opaque, stack-allocated struct for iterating over the elements of a GtkBitset.

Before a GtkBitsetIter can be used, it needs to be initialized with [func`Gtk`.BitsetIter.init_first], [func`Gtk`.BitsetIter.init_last] or [func`Gtk`.BitsetIter.init_at].

classmethod init_at(set, target)[source]
Parameters:
  • set (Gtk.Bitset) – a GtkBitset

  • target (int) – target value to start iterating at

Returns:

True if a value was found.

iter:

a pointer to an uninitialized GtkBitsetIter

value:

Set to the found value in set

Return type:

(bool, iter: Gtk.BitsetIter, value: int)

Initializes iter to point to target.

If target is not found, finds the next value after it. If no value >= target exists in set, this function returns False.

classmethod init_first(set)[source]
Parameters:

set (Gtk.Bitset) – a GtkBitset

Returns:

True if set isn’t empty.

iter:

a pointer to an uninitialized GtkBitsetIter

value:

Set to the first value in set

Return type:

(bool, iter: Gtk.BitsetIter, value: int)

Initializes an iterator for set and points it to the first value in set.

If set is empty, False is returned and value is set to GObject.G_MAXUINT.

classmethod init_last(set)[source]
Parameters:

set (Gtk.Bitset) – a GtkBitset

Returns:

True if set isn’t empty.

iter:

a pointer to an uninitialized GtkBitsetIter

value:

Set to the last value in set

Return type:

(bool, iter: Gtk.BitsetIter, value: int)

Initializes an iterator for set and points it to the last value in set.

If set is empty, False is returned.

get_value()[source]
Returns:

The current value pointer to by self

Return type:

int

Gets the current value that self points to.

If self is not valid and [method`Gtk`.BitsetIter.is_valid] returns False, this function returns 0.

is_valid()[source]
Returns:

True if self points to a valid value

Return type:

bool

Checks if self points to a valid value.

next()[source]
Returns:

True if a next value existed

value:

Set to the next value

Return type:

(bool, value: int)

Moves self to the next value in the set.

If it was already pointing to the last value in the set, False is returned and self is invalidated.

previous()[source]
Returns:

True if a previous value existed

value:

Set to the previous value

Return type:

(bool, value: int)

Moves self to the previous value in the set.

If it was already pointing to the first value in the set, False is returned and self is invalidated.