Skip to content

gh-145578: Add tkinter support for the Tk 9.1 accessibility API#153247

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-145578-accessible
Open

gh-145578: Add tkinter support for the Tk 9.1 accessibility API#153247
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-145578-accessible

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 7, 2026

Copy link
Copy Markdown
Member

Tk 9.1 added the tk accessible command, which exposes widgets to assistive technologies such as screen readers.

The accessible property of widgets returns an Accessible object whose attributes (role, name, description, value, state, action, help) are exposed to assistive technologies, and whose methods register custom widgets with the platform accessibility API. The tk_check_screenreader() method reports whether a screen reader is running.

entry.accessible.name = 'User name'

If no assistive technology is active when the application starts, setting an attribute has no effect and reading it returns 0. Reading an attribute that has never been set raises TclError.

The test requires Tk 9.1 with accessibility support compiled in (ATK on X11) and skips otherwise. Verified against Tk 9.1b1 built with ATK, with and without Orca running.

Alternative design with flat methods: #153246. Only one of the two should be merged.

The accessible property of widgets returns an Accessible object whose
attributes are exposed to assistive technologies such as screen
readers and whose methods register custom widgets with the platform
accessibility API.  The tk_check_screenreader() method reports whether
a screen reader is running.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33473513 | 📁 Comparing fd7a29e against main (35c6779)

  🔍 Preview build  

3 files changed
± library/tkinter.html
± whatsnew/3.16.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant