Ricky - not sure if this got through, so am resending,
In Cocoa, you can get the role description with
NSString *NSAccessibilityRoleDescription(NSString *role, NSString *subrole);
You will find it, and a number of other helpful utility functions in NSAccessibility.h.
Another related function is NSString *NSAccessibilityActionDescription(NSString *action);
Also, you might find these functions useful for traversing the accessibility hierarchy:
APPKIT_EXTERN id NSAccessibilityUnignoredAncestor(id element); APPKIT_EXTERN id NSAccessibilityUnignoredDescendant(id element); APPKIT_EXTERN NSArray *NSAccessibilityUnignoredChildren(NSArray *originalChildren); APPKIT_EXTERN NSArray *NSAccessibilityUnignoredChildrenForOnlyChild(id originalChild);
In cases where I have a UI object that has no Apple equivalent, I do know that I'd need to provide both the role and description (basically what the Clock Control example code does).
Wherever possible, please use existing roles, if the behavior of your UI object is the same or very similar to an existing element. For instance, radio buttons, the segmented control, and the tabs of a tab view are all accessorized as AXRadioButton, since they all give the user the ability to select one choice of a number of items.
You might also want to take a look at the AXCanvas example in /Developer/Accessibility/AXCanvas.
I hope this helps.
-James
-------------------------------------------------- James Dempsey AppKit Engineering Apple
|