tk(accessible)
okay so this is the tk(accessible) page from the Tk manual, and itβs literally about adding screenreader support for core Tk and ttk widgets, bestie π
β¨
π NAME π
accessible β Adds screenreader support for core Tk and ttk widgets. Thatβs the whole vibe: accessibility, but make it built-in π«Ά
β¨ SYNOPSIS β¨
tk accessible set_acc_role window value
tk accessible set_acc_name window value
tk accessible set_acc_description window value
tk accessible set_acc_value window value
tk accessible set_acc_state window value
tk accessible set_acc_action window value
tk accessible set_acc_help window value
tk accessible get_acc_role window
tk accessible get_acc_name window
tk accessible get_acc_description window
tk accessible get_acc_value window
tk accessible get_acc_state window
tk accessible get_acc_action window
tk accessible get_acc_help window
tk accessible add_acc_object window
tk accessible emit_selection_change window
tk accessible emit_focus_change window
tk accessible check_screenreader
πΈ DESCRIPTION πΈ
The tk accessible command makes core Tk and ttk widgets accessible to a screen reader. Periodt. π
π¦ INTRODUCTION π¦
All major computing platforms provide one or more API's to make GUI applications accessible to visually-impaired users who work using screen reader tools. Screen readers provide auditory feedback to users of a GUI application, and may provide additional or alternative methods to navigating GUI's apart from standard keyboard navigation. The tk accessible command layers a platform neutral API on top of platform-specific API's to support accessibility on Linux/Unix, macOS, and Windows. Iconic behavior, honestly π
The tk accessible command is intended to provide a basic accessible-out-of-the-box experience for end users and requires little additional work by developers. If a screen reader is in operation, Tcl/Tk applications will be accessible. The tk accessible command set does allow for additional customization on the part of developers. And widgets that are not part of the core Tk widget set can enable accessibility by using the tk accessible command set to specify the accessible role, name, description, value, state (if applicable), and action (if applicable). Slay π
π OPERATIONS π
The following operations are available for the tk accessible command:
tk accessible set_acc_role window valueβ Assigns one of the following accessibility roles to a Tk widget:Button,Canvas,Checkbutton,Combobox,Entry,Label,Listbox,Menu,Notebook,Progressbar,Scale,Scrollbar,Spinbox,Table,Text, andTree. Tk and ttk widgets having similar roles, such as abuttonand attk::button, will both be assigned the same accessibility role as these widgets are the same from an accessibility standpoint.tk accessible set_acc_name window valueβ Short label identifying the widget. Defaults to the accessibility role.tk accessible set_acc_description window valueβ Longer string providing additional detail about the widget. Depending on the widget, may default to returning the widget's-textoption or some similar detail.tk accessible set_acc_value window valueβ Sets the widget's accessibility value. For instance, with a scale widget, will return the current numeric value of the scale.tk accessible set_acc_state window valueβ Sets the widget's accessibility state, from one of the standard Tk widget states.tk accessible set_acc_action window valueβ Sets the command associated with the widget, if any.tk accessible set_acc_help window valueβ String providing additional information on the widget and its purpose. For instance, can provide details on specific keyboard navigation for the widget.tk accessible get_acc_role windowβ Returns the widget's accessibility role.tk accessible get_acc_name windowβ Returns the widget's accessibility name.tk accessible get_acc_description windowβ Returns the widget's accessibility description.tk accessible get_acc_value windowβ Returns the widget's accessibility value.tk accessible get_acc_state windowβ Returns the widget's accessibility state.tk accessible get_acc_action windowβ Returns the widget's accessibility action.tk accessible get_acc_help windowβ Returns the widget's accessibility help.tk accessible add_acc_object windowβ Registers the widget with the platform's accessibility API and enables accessibility for the widget.tk accessible emit_selection_change windowβ Notifies the system when selection, value or other data associated with the widget changes.tk accessible emit_focus_change windowβ Notifies the accessibility system when focus changes.tk accessible check_screenreaderβ Checks to see if the system is running a screen reader or other accessibility process.
π ADDITIONAL NOTES π
Some Tk GUI components, such as frames and panedwindows, are not included in the accessibility API because they are just containers and do not handle actions or data. Also, the canvas is not included in the accessibility API because it is a purely visual widget; the HTML5 canvas widget is not accessible to web API's for the same reason. Developers may choose to provide alternative data to provide information on the canvas widget, such as labels or help text. Finally, accessibility only runs in the main Tk interpreter, because of potential conflicts in child interpreters; also, accessibility is not supported under XQuartz (the X11 environment on macOS) because of too many conflicts between the X11 and macOS versions of accessibility. Big important caveat energy, fr fr π
π KEYWORDS π
widget, tk
okay bestie, thatβs the whole page β the footer/source-version-date situation is n and tk(accessible), and Iβm obsessed with this entire accessible era πππ
π¦ where this page comes from
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 2025 Kevin Walzer
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms