Re: UIElement references duration of validity?
Re: UIElement references duration of validity?
- Subject: Re: UIElement references duration of validity?
- From: John Louch <email@hidden>
- Date: Mon, 1 Dec 2003 20:33:32 -0800
On Dec 1, 2003, at 8:23 PM, Larry Gerndt wrote:
I'm using the Accessibility API, following the example in the sample
code
called UI Element Inspector, and I've got a question. Here's what I'm
trying to do, in psuedo code:
AXUIElementCopyElementAtPosition(...&curElement);
MyGetParentWindow(curElement, &parentElement);
CFRetain(parentElement);
Depending on how MyGetParentWindow works you probably do not need to
CFRetain the parentElement. All the calls to AX give you back a
"retained" value.
.
. // overlay window appears over the parent at this point, then
later...
.
AXUIElementPerformAction(parentElement, kAXRaiseAction));
// error, return -25202 (invalid element)
What application is returning this error? Is it a carbon or Cocoa app.
Does anyone know why this fails?
In case it helps, MyGetParentWindow() traverses up the UIElement
hierarchy
until it finds an element whose role is "kAXWindow", and I know this
works
because I'm able to get the bounds of that window successfully).
I've also noticed that each time the mouse moves, the references
returned
from the Accessibility API are always different from their former
values.
This leads me to believe that all of the references become invalidated
the
moment the mouse moves. Is that true?
No that is not true. Every time you ask the AX api for an
AXUIElementRef you get back a new pointer value. CFEqual on these
elements will show you that they are equivalent refs, point to the same
thing. Does that make sense?
Thanks,
jl
--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
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.
_______________________________________________
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.