RE: Question about proper use of NSAccessibility APIs
RE: Question about proper use of NSAccessibility APIs
- Subject: RE: Question about proper use of NSAccessibility APIs
- From: "Brant Sears" <email@hidden>
- Date: Wed, 11 Jan 2006 12:27:05 -0500
- Thread-topic: Question about proper use of NSAccessibility APIs
Title: RE: Question about proper use of NSAccessibility APIs
Mike,
Thanks for your informative response. I do have a follow up question.
The accessibilitySetOverrideValue:forAttribute: selector is new in 10.4. My application currently targets the 10.3.9 SDK. Is there another way to programatically set the AXDescription/AXHelp attributes?
Also, I'm getting all kinds of errors and warnings for my application using Accessibility Verifier. I don't know how to fix these. One thing that I think would be helpful is if the Accessibility documentation talked a bit about how to fix some of these errors and warnings.
For example, I'm getting an error that says 'AXCheckBox - "Top", Required attribute AXMaxValue is missing'. Why does a checkbox need an AXMaxValue, and if it needs one, why doesn't interface builder make it for me? How can I add this?
Thank you very much in advance for your help.
Brant Sears
-----Original Message-----
From: Mike Engber [mailto:email@hidden]
Sent: Tue 1/10/2006 4:21 PM
To: Brant Sears
Cc: email@hidden
Subject: Re: Question about proper use of NSAccessibility APIs
The short answer to your questions is you're using the wrong method.
You need to use:
- (BOOL)accessibilitySetOverrideValue:(id)value forAttribute:
(NSString *)attribute;
The longer answer to your question involves understanding that the
accessibilitySetValue:forAttribute: is part of the accessibility
protocol. This is the method that gets called when an assistive app
sets the value of some settable attribute (e.g. the value attribute
of a slider). Most attributes are _not_ settable.
What you want to do, although it may sound similar, is actually
completely different. You want to create a new, unsettable,
attribute. Commonly, this would be an AXDescription attribute.
The fact that you're using NSAccessibilityTitleAttribute is
suspicious. The title attribute is a string visible to the user and
is usually implemented by the widget itself. Specifically, NSButton
provides the title attribute. I can't imagine why you'd need to
override this.
Providing an AXDescription (and possible an AXHelp) seems more likely.
-ME
On Jan 10, 2006, at 9:55 AM, Brant Sears wrote:
> Hi. This is kind of a Cocoa-centric question, so I hope it is OK to
> post it here.
>
> When I use the "Accessibility Verifier" application, I get some
> warnings about missing AXDescription. I went into Interface Builder
> and added descriptions and help info for all of the buttons in my
> nib files. However, I also have an NSMatrix that contains a group
> of NSButtonCell controls. I need to add the AXDescription and help
> information programatically. I am trying to use the following:
>
> [myCell accessibilitySetValue: myDescriptionString
> forAttribute:NSAccessibilityTitleAttribute];
> [myCell accessibilitySetValue: myHelpString
> forAttribute:NSAccessibilityHelpAttribute];
>
> where myCell is an NSButtonCell * and myDescriptionString/
> myHelpString are NSString *.
>
> The problem is that this causes an exception to be raised.
> Obviously I am doing something wrong here. I'm guessing that if I
> call accessibilityIsAttributeSettable: using these attributes on my
> button cells, I will find that these attributes are not settable.
>
> So, my question is, "What is the right thing to do?" to accomplish
> the goal of having an app that correctly provides the hooks for
> Accessibility.
>
> Brant Sears
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Accessibility-dev mailing list (Accessibility-
> email@hidden)
> Help/Unsubscribe/Update your Subscription:
> 40apple.com
>
> This email sent to email@hidden
_______________________________________________
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