Hey Nick,
AX Client Error: An accessibility client attempted to observe "AXUIElementDestroyed" on non-observable element: <LinkProxyObject: 0x61800007d080>. The error kAXErrorNotificationUnsupported has been reported to the client.
Ah, these are tricky to catch — I’m glad to see you’re debugging with NSAccessibilityDebugLogLevel, excellent call Boris for pointing that out!
Taking a quick peek at the project shows LinkProxyObject is subclassing NSObject, meaning you’re adding AX to custom objects.
I believe to resolve the issue above, you can use the accessibilityNotifiesWhenDestroyed API. To implement, in your custom class: 1. Return YES for accessibilityNotifiesWhenDestroyed 2. In dealloc, post an NSAccessibilityUIElementDestroyedNotification
See accessibilityNotifiesWhenDestroyed in the docs:
James suggested in the original email in 2008 that the OP “will also want to" implement NSAccessibilityRTFForRangeParameterizedAttribute. However, I’ve tested it and that attribute is never called so I’ve left it unimplemented for the time being. In what circumstances would the RTF attribute be used instead of the attributed string attribute?
You’re correct, as of now (verified by your investigation for when the attribute is requested), there is no circumstance that uses the RTF attribute instead of the string attribute.
—
> I’m trying to make links in an NSTextFieldCell subclass accessible to VoiceOver in the same way as they work in NSTextViews. I’m hoping for the “link” spoken text and the press action.
I haven’t done a thorough investigation, but it turns out there’re two ways to implement accessible links. You might also try marking the links using the NSAccessibilityLinkTextAttribute instead of having a link object. If I recall correctly, the way you’re doing it via the AXLinkRole provides more flexibility, but it’s a bit tricker to implement.
I think the path you’re going down should work fine — I just want to point out there *may* be a simpler alternative to solve the issue.
Josh
On Aug 19, 2014, at 5:55 PM, Nick Kocharhook < email@hidden> wrote:
I wanted to send an update on this. I’ve gotten the glyph rects working, but this hasn’t resolved the problem.
Accessibility Inspector can see these links, and reports that they’re placed correctly. And yet VoiceOver doesn’t allow me to click them, and doesn’t mention that they are links when I step to them using VO-arrows.
The only hint is that I get this error, although it's intermittent:
2014-08-19 17:51:02.100 StaticTextAccessibility[69997:303] AX Client Error: An accessibility client attempted to observe "AXUIElementDestroyed" on non-observable element: <LinkProxyObject: 0x61800007d080>. The error kAXErrorNotificationUnsupported has
been reported to the client.
Not sure what exactly this means, but I think it has cropped up since my last message. Should it inspire confidence that the LinkProxyObject is clearly being dealt with by the accessibility system, or is it meaningless?
James suggested in the original email in 2008 that the OP “will also want to" implement NSAccessibilityRTFForRangeParameterizedAttribute. However, I’ve tested it and that attribute is never called so I’ve left it unimplemented for the time being. In what
circumstances would the RTF attribute be used instead of the attributed string attribute?
Here’s the latest version of the sample app that I’m testing this with:
Thanks in advance,
-Nick
On Aug 17, 2014, at 22:41, Nick Kocharhook < email@hidden> wrote:
On Aug 15, 2014, at 20:47, Boris Dušek < email@hidden> wrote:
But to the std::map (in our case std::map<NSRange, LinkProxyObject*> - the point is in NSDictionary you can search only for exact match of key - i.e. if you have a link at range (100, 7) and VO requests AXAttributedStringForRange for
(102, 10), you would have no way to get at the link at (100, 7) without walking all values in the NSDictionary (valueForKey:(102, whatever) would return nil, under reasonable assumption there are no overlapping links), and you do need to add part of that link
at (102, 5) to the returned attributed string for (102, 10). But with std::map, you can ask for first value (in our case link) whose key (in our case the range) satisfies an inequality (I mean the lower_bound and upper_bound member functions), so with this
you could get all links that intersect with a certain range in O(log N) (N is the length of the whole text), if for the comparison function of the std::map you use numerical comparison of the location of the range. But if we are speaking about some text that
fits into one screen, I think you should not bother with this yet (however make your own performance measurements :-).
well, now I realize you could do it efficiently without the std::map if you specified [parameter rangeValue] for the inRange: parameter and query selfAttString directly for the border cases…
Yes, I figured that out too. But as you rightly said in your followup, I need to make sure that I’m always returning the same child objects. I tried always creating the objects on the fly (both for AXChildren and separately for the parameterized attributed
string), and VO complained that it couldn’t find the proxy object returned from the parameterized method in the list of children.
I’m at a loss for how to do this properly though given a situation like this:
There are more things in heaven [and] earth, Horatio
If just the single word “and" is selected by the parameterized range, should I really return the same link proxy object as AXChildren has? After all, that object will return a title of “heaven and earth”. But perhaps VO is smart enough to figure that out…
Anyway, I’ve tried that approach and fixed the other problems you’ve pointed out. They’re all in this new version, which sadly still doesn’t work yet:
-Nick
_______________________________________________
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
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
|