Re: kAXWindowsAttribute always returns different AXUIElementRefs
Re: kAXWindowsAttribute always returns different AXUIElementRefs
- Subject: Re: kAXWindowsAttribute always returns different AXUIElementRefs
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 17 Mar 2003 10:48:54 -0500
on 03-03-17 6:31 AM, Matt Gough at email@hidden wrote:
>
When asking for an app's kAXWindowsAttribute the array always comes back
>
with a different set of AXUIElementRefs even though the windows have not
>
changed.
>
>
....
>
>
Can anyone explain why this is? (as opposed to just retaining the
>
AXUIElementRef and returning the same one)
>
>
Thankfully CFEqual does actually return true for the two elements.
That's the way it's designed to work. You get newly allocated
AXUIElementRefs every time you call one of the AX functions with "Copy" or
"Create" in their names, and CFEqual still tells you whether they represent
the same user interface object.
In practice, you should feel free to call an API function whenever you need
to examine a user interface object, instead of calling it once and saving
the AXUIElementRef (although there are sometimes reasons to do the latter).
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.