:right-sidebar: True BitsetIter =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: BitsetIter(*args, **kwargs) :no-contents-entry: 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 :obj:`~gi.repository.Gtk.BitsetIter.init_first`\, :obj:`~gi.repository.Gtk.BitsetIter.init_last` or :obj:`~gi.repository.Gtk.BitsetIter.init_at`\. Methods ------- .. rst-class:: interim-class .. class:: BitsetIter :no-index: .. method:: get_value() -> int Gets the current value that ``iter`` points to. If ``iter`` is not valid and :obj:`~gi.repository.Gtk.BitsetIter.is_valid` returns :const:`False`, this function returns 0. .. classmethod:: init_at(target: int) -> ~typing.Tuple[bool, ~gi.repository.Gtk.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 :const:`False`. :param target: target value to start iterating at .. classmethod:: init_first() -> ~typing.Tuple[bool, ~gi.repository.Gtk.BitsetIter, int] Initializes an iterator for ``set`` and points it to the first value in ``set``\. If ``set`` is empty, :const:`False` is returned and ``value`` is set to %G_MAXUINT. .. classmethod:: init_last() -> ~typing.Tuple[bool, ~gi.repository.Gtk.BitsetIter, int] Initializes an iterator for ``set`` and points it to the last value in ``set``\. If ``set`` is empty, :const:`False` is returned. .. method:: is_valid() -> bool Checks if ``iter`` points to a valid value. .. method:: next() -> ~typing.Tuple[bool, int] Moves ``iter`` to the next value in the set. If it was already pointing to the last value in the set, :const:`False` is returned and ``iter`` is invalidated. .. method:: previous() -> ~typing.Tuple[bool, int] Moves ``iter`` to the previous value in the set. If it was already pointing to the first value in the set, :const:`False` is returned and ``iter`` is invalidated. Fields ------ .. rst-class:: interim-class .. class:: BitsetIter :no-index: .. attribute:: private_data