GNOME Bugzilla – Bug 788517
Can't get Button caption when accessibility name is set
Last modified: 2018-05-02 19:12:35 UTC
When the Accessibility name of ATSPI_ROLE_PUSH_BUTTON is set, there's no way to obtain it's caption/text.
I need it because I want to find the button and check if it contains specific text on it. Needed for example to test string translation etc.
well, this is an accessibility api, not a translation testing api.
Yeah, is there some reason you can't just use gtk_button_get_label()? If the type of widget may vary, you can check it using e.g. if (GTK_IS_BUTTON (widget)), etc.
Daniel, I can't use gtk_button_get_label as I'm trying to access the button from external application, for example python script or accerciser. Matthias, it was just an example to demonstrate the problem, still a good one imho.
Created attachment 361001 [details] Example App that demonstrate the issue In this app first button got the Accessibility name. When Accerciser is used to inspect the buttons, the first one will be seen as "this is acc name" while the second as "Close" The problem occurs when one will try to inspect/access first button caption. With the current Gtk/Atk implementation it's not possible.
to clarify, on IRC it has become clearer that what Marcin would like is for the button's a11y object to implement the AtkText interface
to clarify more I need anything that will allow me to access using atk the button caption when acc name has been set for it. Be it AtkText, or new property, doesn't really matter.
I still think this is a wontfix. Implementing the text interface is not trivial, and I don't see a justification for carrying all that extra code
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/933.