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: Mike Engber <email@hidden>
- Date: Tue, 10 Jan 2006 13:21:38 -0800
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