Re: Adding VO-pressable links to NSTextField
Re: Adding VO-pressable links to NSTextField
- Subject: Re: Adding VO-pressable links to NSTextField
- From: Nick Kocharhook <email@hidden>
- Date: Wed, 20 Aug 2014 18:15:59 +0000
- Thread-topic: Adding VO-pressable links to NSTextField
Thanks very much for the response, Josh. Comments below…
On Aug 20, 2014, at 4:23, Josh Scotland <email@hidden> wrote:
> I believe to resolve the issue above, you can use the accessibilityNotifiesWhenDestroyed API. To implement, in your custom class:
Yes, this worked with no problem. Thanks!
> 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.
Alright, so I won’t worry about it for the time being. For posterity, I found a pretty straightforward implementation of the RTF paramaterized attribute here:
https://github.com/wiseexp/OSXTextMate/blob/e3ca2951506455ca27e3dd0b5353541af0cc89dc/Frameworks/OakFilterList/src/ui/SearchField.mm
> 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’m not sure about this, since NSAccessibilityLinkTextAttribute takes an id as its value, not something more basic like a URL. In fact, kAXLinkTextAttribute says more specifically that it takes an AXUIElementRef.
Your suggestion gave me a thought and I subclassed NSTextView and printed out the parameterized attributed string it was returning from link text. The attributed string has this attribute:
AXLink = "<AXUIElement 0x60000005a640> {pid=72148}”;
Is there anything to be gained by using an AXUIElement (or some equivalent) instead of rolling my own NSObject subclass? How would I even do that?
I’m glad I’m on the right track, but I’m afraid I can’t go any further down this road until I have a clue about what I’m doing wrong, or at least some sample code of this working correctly. Developer sample code claims there are no hits looking for NSAccessibilityLinkTextAttribute. Google and github bring back lots of hits for WebCore (which I’m having trouble parsing as I don’t know that codebase at all) and not much else.
-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