Need help setting up accessibility link from source-view to (subview of) detail-view programmatically
Need help setting up accessibility link from source-view to (subview of) detail-view programmatically
- Subject: Need help setting up accessibility link from source-view to (subview of) detail-view programmatically
- From: Motti Shneor <email@hidden>
- Date: Fri, 25 May 2012 13:22:25 +0300
Hello again.
I have a source-detail window, where the source is an NSOutlineView (handled the "classic" way, i.e. NSOutlineView/NSTableView data-source and delegate methods).
As usual, selecting an object on the source-view brings up a matching view on the detail view. My "detail views" are loaded from standalone .xib files at runtime.
I wish to set up an accessibility link from the currently-selected item in the source-view, to a specialized, pre-defined UI element on the detail view (which is different for different detail view types). So that a voiceover user will VO-J to directly jump from the selected item to the "initial responder" of the detail view.
I cannot, of course, set this up in my .xib files, because I can't link elements in one xib to elements in another .xib. Above this, my accessibility links change as user clicks on different items.
Here's the code I wrote for this. I didn't see any flaw in it - yet it doesn't work. Using accessibility inspector I can see there is an accessibility-link on the selected item, but its value is "0" and its type is "AXUnknown". I have debugged the code thoroughly, so I know the objects I'm using are alive and well.
Maybe I got something wrong here?
- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
id newSelectedItem = [self selectedSourceViewItem];
[self updateDetailViewForItem:newSelectedItem];
// Set up Accessibility link from selected item to its detail-view's initial responder.
NSView *detailInitialResponder = [self.detailViewController initialFirstResponder];
if (detailInitialResponder != nil) {
NSMutableArray *accessibilityLinks = [NSArray arrayWithObjects:detailInitialResponder, nil];
id accessibilityItem = [[_sourceView tableColumnWithIdentifier:@"Label"] dataCellForRow:[_sourceView rowForItem:item]];
BOOL linkIsSet = [accessibilityItem accessibilitySetOverrideValue:accessibilityLinks forAttribute:NSAccessibilityLinkedUIElementsAttribute];
}
* detailViewController is a subclass of NSViewController, that returns a predefined view (usually user-focusable control) for its view.
** linkIsSet is YES at the end of the method, and my initialFirstResponder is usually just a button, or text-field.
I'd be very thankful for any hint...
Motti Shneor,
Spectrum Reflections Ltd.
_______________________________________________
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