Re: AXIdentifier not always allowed?
Re: AXIdentifier not always allowed?
- Subject: Re: AXIdentifier not always allowed?
- From: Eric Schlegel <email@hidden>
- Date: Fri, 31 Oct 2014 08:49:43 -0700
On Oct 31, 2014, at 8:12 AM, Nick Kocharhook < email@hidden> wrote:
I would like to use the AXIdentifier as a non-localised way to introspect the UI and identify elements for testing. This works well with buttons and other standard views where you can just add a string to the “Identifier” field in IB.
However, I’m trying to do this with NSMenuItems and the accessibility inspector isn’t reporting the AXIdentifier. I have to say, I was afraid this would happen since IB didn’t let me add the string in the first place…
Are there rules about which elements of the UI are allowed to have AXIdentifiers? I can’t find much on it in the documentation, just this warning:
"An identifier should be provided only if the same UI element reports the same identifier across
multiple launches of the application."
Which mine will. This is the subclass of NSMenuItem which I’ve created and am using in a test app’s Main Menu:
Menu items have… interesting… accessibility aspects. Menus in OS X are still implementing using the Carbon menu system, so all menu accessibility is provided by HIToolbox accessibility rather than AppKit accessibility.
In short, it’s probably not going to be possible to override menu accessibility features using AppKit API, and there’s no supported way to get the Carbon menu from an NSMenu, so you really shouldn’t try to use Carbon API either.
-eric
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden