:right-sidebar: True Accessible =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: Accessible(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Gtk.AboutDialog`, :class:`~gi.repository.Gtk.ActionBar`, :class:`~gi.repository.Gtk.AppChooserButton`, :class:`~gi.repository.Gtk.AppChooserDialog`, :class:`~gi.repository.Gtk.AppChooserWidget`, :class:`~gi.repository.Gtk.ApplicationWindow`, :class:`~gi.repository.Gtk.AspectFrame`, :class:`~gi.repository.Gtk.Assistant`, :class:`~gi.repository.Gtk.Box`, :class:`~gi.repository.Gtk.Button`, :class:`~gi.repository.Gtk.Calendar`, :class:`~gi.repository.Gtk.CellView`, :class:`~gi.repository.Gtk.CenterBox`, :class:`~gi.repository.Gtk.CheckButton`, :class:`~gi.repository.Gtk.ColorButton`, :class:`~gi.repository.Gtk.ColorChooserDialog`, :class:`~gi.repository.Gtk.ColorChooserWidget`, :class:`~gi.repository.Gtk.ColorDialogButton`, :class:`~gi.repository.Gtk.ColumnView`, :class:`~gi.repository.Gtk.ComboBox`, :class:`~gi.repository.Gtk.ComboBoxText`, :class:`~gi.repository.Gtk.Dialog`, :class:`~gi.repository.Gtk.DragIcon`, :class:`~gi.repository.Gtk.DrawingArea`, :class:`~gi.repository.Gtk.DropDown`, :class:`~gi.repository.Gtk.EditableLabel`, :class:`~gi.repository.Gtk.EmojiChooser`, :class:`~gi.repository.Gtk.Entry`, :class:`~gi.repository.Gtk.Expander`, :class:`~gi.repository.Gtk.FileChooserDialog`, :class:`~gi.repository.Gtk.FileChooserWidget`, :class:`~gi.repository.Gtk.Fixed`, :class:`~gi.repository.Gtk.FlowBox`, :class:`~gi.repository.Gtk.FlowBoxChild`, :class:`~gi.repository.Gtk.FontButton`, :class:`~gi.repository.Gtk.FontChooserDialog`, :class:`~gi.repository.Gtk.FontChooserWidget`, :class:`~gi.repository.Gtk.FontDialogButton`, :class:`~gi.repository.Gtk.Frame`, :class:`~gi.repository.Gtk.GLArea`, :class:`~gi.repository.Gtk.GraphicsOffload`, :class:`~gi.repository.Gtk.Grid`, :class:`~gi.repository.Gtk.GridView`, :class:`~gi.repository.Gtk.HeaderBar`, :class:`~gi.repository.Gtk.IconView`, :class:`~gi.repository.Gtk.Image`, :class:`~gi.repository.Gtk.InfoBar`, :class:`~gi.repository.Gtk.Inscription`, :class:`~gi.repository.Gtk.Label`, :class:`~gi.repository.Gtk.LevelBar`, :class:`~gi.repository.Gtk.LinkButton`, :class:`~gi.repository.Gtk.ListBase`, :class:`~gi.repository.Gtk.ListBox`, :class:`~gi.repository.Gtk.ListBoxRow`, :class:`~gi.repository.Gtk.ListView`, :class:`~gi.repository.Gtk.LockButton`, :class:`~gi.repository.Gtk.MediaControls`, :class:`~gi.repository.Gtk.MenuButton`, :class:`~gi.repository.Gtk.MessageDialog`, :class:`~gi.repository.Gtk.Notebook`, :class:`~gi.repository.Gtk.Overlay`, :class:`~gi.repository.Gtk.PageSetupUnixDialog`, :class:`~gi.repository.Gtk.Paned`, :class:`~gi.repository.Gtk.PasswordEntry`, :class:`~gi.repository.Gtk.Picture`, :class:`~gi.repository.Gtk.Popover`, :class:`~gi.repository.Gtk.PopoverMenu`, :class:`~gi.repository.Gtk.PopoverMenuBar`, :class:`~gi.repository.Gtk.PrintUnixDialog`, :class:`~gi.repository.Gtk.ProgressBar`, :class:`~gi.repository.Gtk.Range`, :class:`~gi.repository.Gtk.Revealer`, :class:`~gi.repository.Gtk.Scale`, :class:`~gi.repository.Gtk.ScaleButton`, :class:`~gi.repository.Gtk.Scrollbar`, :class:`~gi.repository.Gtk.ScrolledWindow`, :class:`~gi.repository.Gtk.SearchBar`, :class:`~gi.repository.Gtk.SearchEntry`, :class:`~gi.repository.Gtk.Separator`, :class:`~gi.repository.Gtk.ShortcutLabel`, :class:`~gi.repository.Gtk.ShortcutsGroup`, :class:`~gi.repository.Gtk.ShortcutsSection`, :class:`~gi.repository.Gtk.ShortcutsShortcut`, :class:`~gi.repository.Gtk.ShortcutsWindow`, :class:`~gi.repository.Gtk.SpinButton`, :class:`~gi.repository.Gtk.Spinner`, :class:`~gi.repository.Gtk.Stack`, :class:`~gi.repository.Gtk.StackPage`, :class:`~gi.repository.Gtk.StackSidebar`, :class:`~gi.repository.Gtk.StackSwitcher`, :class:`~gi.repository.Gtk.Statusbar`, :class:`~gi.repository.Gtk.Switch`, :class:`~gi.repository.Gtk.Text`, :class:`~gi.repository.Gtk.TextView`, :class:`~gi.repository.Gtk.ToggleButton`, :class:`~gi.repository.Gtk.TreeExpander`, :class:`~gi.repository.Gtk.TreeView`, :class:`~gi.repository.Gtk.Video`, :class:`~gi.repository.Gtk.Viewport`, :class:`~gi.repository.Gtk.VolumeButton`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.Gtk.Window`, :class:`~gi.repository.Gtk.WindowControls`, :class:`~gi.repository.Gtk.WindowHandle` ``GtkAccessible`` is an interface for describing UI elements for Assistive Technologies. Every accessible implementation has: - a “role”, represented by a value of the :obj:`~gi.repository.Gtk.AccessibleRole` enumeration - an “attribute”, represented by a set of :obj:`~gi.repository.Gtk.AccessibleState`, :obj:`~gi.repository.Gtk.AccessibleProperty` and :obj:`~gi.repository.Gtk.AccessibleRelation` values The role cannot be changed after instantiating a ``GtkAccessible`` implementation. The attributes are updated every time a UI element's state changes in a way that should be reflected by assistive technologies. For instance, if a ``GtkWidget`` visibility changes, the :const:`~gi.repository.Gtk.AccessibleState.HIDDEN` state will also change to reflect the :obj:`~gi.repository.Gtk.Widget.props.visible` property. Every accessible implementation is part of a tree of accessible objects. Normally, this tree corresponds to the widget tree, but can be customized by reimplementing the :obj:`~gi.repository.Gtk.Accessible.get_accessible_parent`, :obj:`~gi.repository.Gtk.Accessible.get_first_accessible_child` and :obj:`~gi.repository.Gtk.Accessible.get_next_accessible_sibling` virtual functions. Note that you can not create a top-level accessible object as of now, which means that you must always have a parent accessible object. Also note that when an accessible object does not correspond to a widget, and it has children, whose implementation you don't control, it is necessary to ensure the correct shape of the a11y tree by calling :obj:`~gi.repository.Gtk.Accessible.set_accessible_parent` and updating the sibling by :obj:`~gi.repository.Gtk.Accessible.update_next_accessible_sibling`. Methods ------- .. rst-class:: interim-class .. class:: Accessible :no-index: .. method:: announce(message: str, priority: ~gi.repository.Gtk.AccessibleAnnouncementPriority) -> None Requests the user's screen reader to announce the given message. This kind of notification is useful for messages that either have only a visual representation or that are not exposed visually at all, e.g. a notification about a successful operation. Also, by using this API, you can ensure that the message does not interrupts the user's current screen reader output. .. versionadded:: 4.14 :param message: the string to announce :param priority: the priority of the announcement .. method:: get_accessible_parent() -> ~gi.repository.Gtk.Accessible | None Retrieves the accessible parent for an accessible object. This function returns ``NULL`` for top level widgets. .. versionadded:: 4.10 .. method:: get_accessible_role() -> ~gi.repository.Gtk.AccessibleRole Retrieves the accessible role of an accessible object. .. method:: get_at_context() -> ~gi.repository.Gtk.ATContext Retrieves the accessible implementation for the given ``GtkAccessible``. .. versionadded:: 4.10 .. method:: get_bounds() -> tuple[bool, int, int, int, int] Queries the coordinates and dimensions of this accessible This functionality can be overridden by ``GtkAccessible`` implementations, e.g. to get the bounds from an ignored child widget. .. versionadded:: 4.10 .. method:: get_first_accessible_child() -> ~gi.repository.Gtk.Accessible | None Retrieves the first accessible child of an accessible object. .. versionadded:: 4.10 .. method:: get_next_accessible_sibling() -> ~gi.repository.Gtk.Accessible | None Retrieves the next accessible sibling of an accessible object .. versionadded:: 4.10 .. method:: get_platform_state(state: ~gi.repository.Gtk.AccessiblePlatformState) -> bool Query a platform state, such as focus. See gtk_accessible_platform_changed(). This functionality can be overridden by ``GtkAccessible`` implementations, e.g. to get platform state from an ignored child widget, as is the case for ``GtkText`` wrappers. .. versionadded:: 4.10 :param state: platform state to query .. method:: reset_property(property: ~gi.repository.Gtk.AccessibleProperty) -> None Resets the accessible ``property`` to its default value. :param property: a ``GtkAccessibleProperty`` .. method:: reset_relation(relation: ~gi.repository.Gtk.AccessibleRelation) -> None Resets the accessible ``relation`` to its default value. :param relation: a ``GtkAccessibleRelation`` .. method:: reset_state(state: ~gi.repository.Gtk.AccessibleState) -> None Resets the accessible ``state`` to its default value. :param state: a ``GtkAccessibleState`` .. method:: set_accessible_parent(parent: ~gi.repository.Gtk.Accessible | None = None, next_sibling: ~gi.repository.Gtk.Accessible | None = None) -> None Sets the parent and sibling of an accessible object. This function is meant to be used by accessible implementations that are not part of the widget hierarchy, and but act as a logical bridge between widgets. For instance, if a widget creates an object that holds metadata for each child, and you want that object to implement the ``GtkAccessible`` interface, you will use this function to ensure that the parent of each child widget is the metadata object, and the parent of each metadata object is the container widget. .. versionadded:: 4.10 :param parent: the parent accessible object :param next_sibling: the sibling accessible object .. method:: update_next_accessible_sibling(new_sibling: ~gi.repository.Gtk.Accessible | None = None) -> None Updates the next accessible sibling of ``self``. That might be useful when a new child of a custom ``GtkAccessible`` is created, and it needs to be linked to a previous child. .. versionadded:: 4.10 :param new_sibling: the new next accessible sibling to set .. method:: update_property(properties: ~typing.Sequence[~gi.repository.Gtk.AccessibleProperty], values: ~typing.Sequence[~typing.Any]) -> None Updates a list of accessible properties. See the :obj:`~gi.repository.Gtk.AccessibleProperty` documentation for the value types of accessible properties. This function should be called by ``GtkWidget`` types whenever an accessible property change must be communicated to assistive technologies. Example: .. code-block:: :dedent: value = gtk_adjustment_get_value (adjustment); gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, -1); :param properties: :param values: .. method:: update_relation(relations: ~typing.Sequence[~gi.repository.Gtk.AccessibleRelation], values: ~typing.Sequence[~typing.Any]) -> None Updates a list of accessible relations. This function should be called by ``GtkWidget`` types whenever an accessible relation change must be communicated to assistive technologies. If the :obj:`~gi.repository.Gtk.AccessibleRelation` requires a list of references, you should pass each reference individually, followed by :const:`None`, e.g. .. code-block:: :dedent: gtk_accessible_update_relation (accessible, GTK_ACCESSIBLE_RELATION_CONTROLS, ref1, NULL, GTK_ACCESSIBLE_RELATION_LABELLED_BY, ref1, ref2, ref3, NULL, -1); :param relations: :param values: .. method:: update_state(states: ~typing.Sequence[~gi.repository.Gtk.AccessibleState], values: ~typing.Sequence[~typing.Any]) -> None Updates a list of accessible states. See the :obj:`~gi.repository.Gtk.AccessibleState` documentation for the value types of accessible states. This function should be called by ``GtkWidget`` types whenever an accessible state change must be communicated to assistive technologies. Example: .. code-block:: :dedent: value = GTK_ACCESSIBLE_TRISTATE_MIXED; gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), GTK_ACCESSIBLE_STATE_CHECKED, value, -1); :param states: :param values: Properties ---------- .. rst-class:: interim-class .. class:: Accessible :no-index: .. attribute:: props.accessible_role :type: ~gi.repository.Gtk.AccessibleRole The accessible role of the given ``GtkAccessible`` implementation. The accessible role cannot be changed once set. Virtual Methods --------------- .. rst-class:: interim-class .. class:: Accessible :no-index: .. method:: do_get_accessible_parent() -> ~gi.repository.Gtk.Accessible | None Retrieves the accessible parent for an accessible object. This function returns ``NULL`` for top level widgets. .. versionadded:: 4.10 .. method:: do_get_at_context() -> ~gi.repository.Gtk.ATContext | None Retrieves the accessible implementation for the given ``GtkAccessible``. .. versionadded:: 4.10 .. method:: do_get_bounds() -> tuple[bool, int, int, int, int] Queries the coordinates and dimensions of this accessible This functionality can be overridden by ``GtkAccessible`` implementations, e.g. to get the bounds from an ignored child widget. .. versionadded:: 4.10 .. method:: do_get_first_accessible_child() -> ~gi.repository.Gtk.Accessible | None Retrieves the first accessible child of an accessible object. .. versionadded:: 4.10 .. method:: do_get_next_accessible_sibling() -> ~gi.repository.Gtk.Accessible | None Retrieves the next accessible sibling of an accessible object .. versionadded:: 4.10 .. method:: do_get_platform_state(state: ~gi.repository.Gtk.AccessiblePlatformState) -> bool Query a platform state, such as focus. See gtk_accessible_platform_changed(). This functionality can be overridden by ``GtkAccessible`` implementations, e.g. to get platform state from an ignored child widget, as is the case for ``GtkText`` wrappers. .. versionadded:: 4.10 :param state: platform state to query