Re: Role descriptions for custom controls
Re: Role descriptions for custom controls
- Subject: Re: Role descriptions for custom controls
- From: David Niemeijer <email@hidden>
- Date: Mon, 3 Jul 2006 19:17:21 +0200
At 12:05 -0500 3/7/06, Ricky Sharp wrote:
I'm in the process of making my Cocoa app accessibile. The app uses
a completely custom UI (subclasses of NSView, NSControl and
NSCell/NSActionCell). I thus have my own buttons, checkboxes,
lists, etc.
I know I need to implement accessibilityAttributeValue: and return
appropriate role constants for the NSAccessibilityRoleAttribute
attribute. For example, when my IIButton object represents a
checkbox, I'll have it send back NSAccessibilityCheckBoxRole.
Question...do I need to additionally have my custom objects return
info for NSAccessibilityRoleDescriptionAttribute? Or, will the
superclass be able to do the right thing
Building on the above example, because I'm setting
NSAccessibilityCheckBoxRole for the NSAccessibilityRoleAttribute,
will the superclass be able to look up the correct role description
automatically? I'm hoping the answer is yes as that I would not
need to store localized descriptions for these common UI elements.
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).
Ricky, two things:
1) You should be able to use the accessibility inspector to verify
whether a proper role description is provided by the super class (I
am not a Cocoa program so would not know).
2) In Carbon, and perhaps also in Cocoa you can use
CFStringRef HICopyAccessibilityRoleDescription(CFStringRef inRole,
CFStringRef inSubrole);
Given the role and subrole this should deliver a localized role
description. There may be a Ccoa equivalent or because NSString and
CFString are exchangeable you could probably use this carbon function.
david.
_______________________________________________
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