Using title UI element in custom descriptions
Using title UI element in custom descriptions
- Subject: Using title UI element in custom descriptions
- From: Ricky Sharp <email@hidden>
- Date: Tue, 18 Jul 2006 21:29:38 -0500
I have a couple of custom controls that provide a custom handler for
NSAccessibilityDescriptionAttribute. Part of the description that I
build will be the control's title. The title can either come from
the title attribute of the cell, or from a linked UI title element
(set up in IB).
I've tried unsuccessfully in obtaining the title element. Here's
what I did in my cell subclass:
- (id)accessibilityAttributeValue:(NSString*)anAttribute
{
id theValue = nil;
if ([anAttribute
isEqualToString:NSAccessibilityDescriptionAttribute])
{
NSString* theTitle = nil;
id theTitleUIElement = [super
accessibilityAttributeValue:NSAccessibilityTitleUIElementAttribute];
if (theTitleUIElement != nil)
theTitle = [theTitleUIElement
accessibilityAttributeValue:NSAccessibilityTitleAttribute];
else
theTitle = [self title];
// build up theValue here with custom description using the
title
}
...
return theValue;
}
For cells with both linked an non-linked title ui elements, I always
get back a nil from my call to super. I couldn't find any dedicated
function to obtain the title UI element. How does one access it?
Workaround...It won't be the end of the world if I can't do this as
I'll just always set up the cell's title attribute and never link to
a static text item to serve as the title.
Furthermore, I've found it interesting that NSCell subclasses do not
provide the NSAccessibilityTitleUIElementAttribute. However,
NSActionCell subclasses do. I'll file a documentation enhancement
request to beef up the "supported attributes" table to include
NSActionCell as that's a common class to subclass:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
Accessibility/cocoaAXAccessEnabling/cocoaAXAccessEnabling.html>
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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