BitsetIter#

class BitsetIter(*args, **kwargs)#

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 init_first, init_last or init_at.

Methods#

class BitsetIter
get_value() int#

Gets the current value that iter points to.

If iter is not valid and is_valid returns False, this function returns 0.

init_at(set: Bitset, target: int) tuple[bool, BitsetIter, 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.

Parameters:
  • set – a GtkBitset

  • target – target value to start iterating at

init_first(set: Bitset) tuple[bool, BitsetIter, 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 %G_MAXUINT.

Parameters:

set – a GtkBitset

init_last(set: Bitset) tuple[bool, BitsetIter, int]#

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

If set is empty, False is returned.

Parameters:

set – a GtkBitset

is_valid() bool#

Checks if iter points to a valid value.

next() tuple[bool, int]#

Moves iter to the next value in the set.

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

previous() tuple[bool, int]#

Moves iter to the previous value in the set.

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

Fields#

class BitsetIter
private_data#