Re: How to programmatically open an NSComboBox's list?
Re: How to programmatically open an NSComboBox's list?
- Subject: Re: How to programmatically open an NSComboBox's list?
- From: Jens Alfke <email@hidden>
- Date: Thu, 17 Jul 2008 12:22:16 -0700
On 17 Jul '08, at 11:29 AM, Omar Qazi wrote:
Maybe you could fake the mouse even that would normally pop it open.
Actually, after some experimentation I figured out how to do it using
the accessibility API:
@interface NSComboBox (MYExpansionAPI)
@property (getter=isExpanded) BOOL expanded;
@end
@implementation NSComboBox (MYExpansionAPI)
- (BOOL) isExpanded
{
id ax = NSAccessibilityUnignoredDescendant(self);
return [[ax accessibilityAttributeValue:
NSAccessibilityExpandedAttribute] boolValue];
}
- (void) setExpanded: (BOOL)expanded
{
id ax = NSAccessibilityUnignoredDescendant(self);
[ax accessibilitySetValue: [NSNumber numberWithBool: expanded]
forAttribute: NSAccessibilityExpandedAttribute];
}
@end
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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