AccessibleText#

Added in version 4.14.

class AccessibleText(*args, **kwargs)#

Implementations: Inscription, Label, Text, 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 LABEL or the DESCRIPTION properties for accessible objects containing simple, unformatted text.

Methods#

class AccessibleText
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.

Added in version 4.14.

update_contents(change: 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.

Added in version 4.14.

Parameters:
  • change – the type of change in the contents

  • start – the starting offset of the change, in characters

  • end – the end offset of the change, in characters

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.

Added in version 4.14.

Virtual Methods#

class AccessibleText
do_get_attributes(offset: int) tuple[bool, list[AccessibleTextRange], list[str], list[str]]#

The type of the None singleton.

Added in version 4.14.

Parameters:

offset – the offset, in characters

do_get_caret_position() int#

The type of the None singleton.

Added in version 4.14.

do_get_contents(start: int, end: int) Bytes#

The type of the None singleton.

Added in version 4.14.

Parameters:
  • start – the beginning of the range, in characters

  • end – the end of the range, in characters

do_get_contents_at(offset: int, granularity: AccessibleTextGranularity) tuple[Bytes, int, int]#

The type of the None singleton.

Added in version 4.14.

Parameters:
  • offset – the offset, in characters

  • granularity – the granularity of the query

do_get_default_attributes() tuple[list[str], list[str]]#

The type of the None singleton.

Added in version 4.14.

do_get_extents(start: int, end: int, extents: Rect) bool#

The type of the None singleton.

Added in version 4.16.

Parameters:
  • start – the start offset, in characters

  • end – the end offset, in characters, extents (out caller-allocates): return location for the extents

  • extents

do_get_offset(point: Point) tuple[bool, int]#

The type of the None singleton.

Added in version 4.16.

Parameters:

point – a point in widget coordinates of self

do_get_selection() tuple[bool, list[AccessibleTextRange]]#

The type of the None singleton.

Added in version 4.14.