Re: Counting children of menubar
Re: Counting children of menubar
- Subject: Re: Counting children of menubar
- From: Guy Fullerton <email@hidden>
- Date: Tue, 05 Nov 2002 10:32:01 -0800
On 11/5/02 2:36 AM, "Bill Cheeseman" <email@hidden> wrote:
>
I'm writing a Cocoa framework to wrap the Carbon assistive application APIs.
FYI: The Accessibility APIs (in <HIServices/Accessibility.h> and its
sub-headers) are neither Carbon nor Cocoa APIs. They're just APIs.
>
Instead, to get the count of children, I use AXUIElementCopyAttributeValue
>
to load the AXChildren attribute (an array value) itself, then use an array
>
function to count the items in the array.
>
>
And to get the children, I use AXUIElementCopyAttributeValue to load the
>
AXChildren array as above, then use the count workaround and an array
>
function to get the subarray from index for length maxItems.
Those are both excellent workarounds.
>
These workarounds are so easy that I am led to believe the
>
AXUIElementGetAttributeValueCount and AXUIElementCopyAttributeValues
>
functions are merely convenience functions that work the same way.
Actually, they don't necessarily work that same way. (They do in some cases,
but not in others.) Carbon and Cocoa can have much more efficient ways of
generating counts of attributes or sub-ranges of attribute arrays than
fetching the whole attribute array. Cocoa does some of this now, and Carbon
will do it in the near future.
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.