Topics

Setting accessibility text for a table cell view

John Brownie
 

I'm new at accessibility, and have recently been supporting a blind user. One of the tables in my conveys information in shorthand by using colours and styles, which don't come across with VoiceOver. I'd like to be able to have VO read an alternate text when reading the cell. It's a basic view-based table, using NSTableCellView.

I searched and found an old solution involving subclassing NSTableCellView and overriding accessibilityAttributeValue, but that's deprecated.
https://stackoverflow.com/questions/16193012/nstextfield-accessibility-how-to-provide-alternate-text-for-voiceover

If I set the accessibility title, I get the contents of the cell and my alternate text read, but I only want the alternate text to be read out. Do I need to subclass, and if so, what methods do I need to override? Or what other calls should I make to get only what I want read by VO?

Thanks for any pointers!

John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland

John Brownie
 

Nobody?

I've been playing around with the Accessibility Inspector, and it seems that there are both Title and Value which get read out. I don't seem to be able to set the value, though, as it is being derived down in the NSTextFieldCell, and it trumps whatever I try to set at the NSTextField level.

Another issue is when the text field has an empty string. I would like to have something read out by VO, but setting the title doesn't work.

All of this is being done in -tableView:viewForTableColumn:row:, but perhaps there's a better place to do it?

Ideally, I'd like to support back to 10.9, but I'm willing to use later if necessary.

John

John Brownie
 

I found my stupid error, that I should be calling -setAccessibilityValueDescription:, rather than -setAccessibilityValue: or -setAccessibilityTitle:. A case of reading what I initially found more carefully!

John