• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessibility in custom NSControl subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessibility in custom NSControl subclasses


  • Subject: Re: Accessibility in custom NSControl subclasses
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Mon, 28 Feb 2011 11:08:37 -0600

nevermind, i'm going to post this question on the Accessibility list instead.

On 27 Feb 2011, at 19:12, Stephen Blinkhorn wrote:

Hello,

I make extensive use of custom NSControls in some of my GUIs. Recently I ran into a problem whilst trying to implement accessibility features in these controls.

I have added the test methods below which work perfectly for custom NSView classes but are not working as expected with custom NSControl classes. With custom NSControl classes voice over reads out the application name instead of value, role and description details.

Can anyone shed any light on why this is happening? Maybe it is worth mentioning that none of my controls use NSCell classes at this time.


-(BOOL)accessibilityIsIgnored { return NO; }

-(NSArray*)accessibilityAttributeNames
{
NSArray* attributes = [super accessibilityAttributeNames];
NSMutableArray* mutable_attributes = [[NSMutableArray alloc] initWithCapacity:[attributes count]];
[mutable_attributes addObjectsFromArray:attributes];
[mutable_attributes addObject:NSAccessibilityValueAttribute];
[mutable_attributes addObject:NSAccessibilityValueDescriptionAttribute];
return (NSArray*)mutable_attributes;
}


-(id)accessibilityAttributeValue:(NSString *)attribute
{
if([attribute isEqualToString:NSAccessibilityRoleAttribute]) {
return NSAccessibilitySliderRole;
} else if([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
return NSAccessibilityRoleDescriptionForUIElement(self);
} else if([attribute isEqualToString:NSAccessibilityValueAttribute]) {
return [NSNumber numberWithFloat:50.0];
} else if([attribute isEqualToString:NSAccessibilityValueDescriptionAttribute]) {
return @"50%";
} else {
return [super accessibilityAttributeValue:attribute];
};
}


Thanks,
Stephen
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Accessibility in custom NSControl subclasses (From: Stephen Blinkhorn <email@hidden>)

  • Prev by Date: Re: WindowID to front
  • Next by Date: Re: WindowID to front
  • Previous by thread: Accessibility in custom NSControl subclasses
  • Next by thread: WindowID to front
  • Index(es):
    • Date
    • Thread