:right-sidebar: True AccessibleText =================================================================== .. currentmodule:: gi.repository.Gtk .. versionadded:: 4.14 .. class:: AccessibleText(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Gtk.Inscription`, :class:`~gi.repository.Gtk.Label`, :class:`~gi.repository.Gtk.Text`, :class:`~gi.repository.Gtk.TextView` An interface for accessible objects containing formatted text. The ``GtkAccessibleText`` interfaces is meant to be implemented by accessible objects that have text formatted with attributes, or non-trivial text contents. You should use the :obj:`~gi.repository.Gtk.AccessibleProperty.LABEL` or the :obj:`~gi.repository.Gtk.AccessibleProperty.DESCRIPTION` properties for accessible objects containing simple, unformatted text. Methods ------- .. rst-class:: interim-class .. class:: AccessibleText :no-index: .. method:: update_caret_position() -> None Updates the position of the caret. Implementations of the ``GtkAccessibleText`` interface should call this function every time the caret has moved, in order to notify assistive technologies. .. versionadded:: 4.14 .. method:: update_contents(change: ~gi.repository.Gtk.AccessibleTextContentChange, start: int, end: int) -> None Notifies assistive technologies of a change in contents. Implementations of the ``GtkAccessibleText`` interface should call this function every time their contents change as the result of an operation, like an insertion or a removal. Note: If the change is a deletion, this function must be called *before* removing the contents, if it is an insertion, it must be called *after* inserting the new contents. .. versionadded:: 4.14 :param change: the type of change in the contents :param start: the starting offset of the change, in characters :param end: the end offset of the change, in characters .. method:: update_selection_bound() -> None Updates the boundary of the selection. Implementations of the ``GtkAccessibleText`` interface should call this function every time the selection has moved, in order to notify assistive technologies. .. versionadded:: 4.14 Virtual Methods --------------- .. rst-class:: interim-class .. class:: AccessibleText :no-index: .. method:: do_get_attributes(offset: int) -> ~typing.Tuple[bool, list[~gi.repository.Gtk.AccessibleTextRange], list[str], list[str]] The type of the None singleton. .. versionadded:: 4.14 :param offset: the offset, in characters .. method:: do_get_caret_position() -> int The type of the None singleton. .. versionadded:: 4.14 .. method:: do_get_contents(start: int, end: int) -> ~gi.repository.GLib.Bytes The type of the None singleton. .. versionadded:: 4.14 :param start: the beginning of the range, in characters :param end: the end of the range, in characters .. method:: do_get_contents_at(offset: int, granularity: ~gi.repository.Gtk.AccessibleTextGranularity) -> ~typing.Tuple[~gi.repository.GLib.Bytes, int, int] The type of the None singleton. .. versionadded:: 4.14 :param offset: the offset, in characters :param granularity: the granularity of the query .. method:: do_get_default_attributes() -> ~typing.Tuple[list[str], list[str]] The type of the None singleton. .. versionadded:: 4.14 .. method:: do_get_extents(start: int, end: int, extents: ~gi.repository.Graphene.Rect) -> bool The type of the None singleton. .. versionadded:: 4.16 :param start: the start offset, in characters :param end: the end offset, in characters, ``extents`` (out caller-allocates): return location for the extents :param extents: .. method:: do_get_offset(point: ~gi.repository.Graphene.Point) -> ~typing.Tuple[bool, int] The type of the None singleton. .. versionadded:: 4.16 :param point: a point in widget coordinates of ``self`` .. method:: do_get_selection() -> ~typing.Tuple[bool, list[~gi.repository.Gtk.AccessibleTextRange]] The type of the None singleton. .. versionadded:: 4.14