Re: Window closed notification
Re: Window closed notification
- Subject: Re: Window closed notification
- From: James Dempsey <email@hidden>
- Date: Mon, 21 Jun 2010 14:42:01 -0700
On Jun 21, 2010, at 2:36 PM, Ryan Joseph wrote:
>
> On Jun 21, 2010, at 3:15 PM, James Dempsey wrote:
>
>>> Indeed this is what I want. However, I noticed that the AXUIElement returned in the callback didn't have any attributes so I'm not sure which window was destroyed. Is it possible that I could keep a cached list of window elements then compare them with the element from the callback? I'm not sure how safe it is to CFRetain on the element and if I really will retain ownership. Thanks for helping.
>>
>> An AXUIElementRef has the standard CF retain/release semantics. The AXUIElement ref you receive back in the element destroyed notification should compare as CFEquals() to any AXUIElementRef you already have for that element.
>
>
> Well the retaining did work and testing for equality but the element still seems to have lost all its internal data so I guess the API was keeping it elsewhere. I can keep my own records along side the dead-reference for comparing so it should it should still work.
Ryan,
It may be helpful to keep in mind that when you use AX calls, you are essentially the client of a little 'client-server' operation. Your process is the client, the applications you are getting accessibility information about are the 'servers'.
An AXUIElementRef is just a little token object. When you make an AX call and pass in the AXUIElementRef, that token is sent to the application it belongs to, and that application uses the info in the token to find the correct UI element object in the app, and then gets the appropriate accessibility info from it.
Every time you ask an AXUIElementRef for something (attribute values, action names, etc.), it makes the cross-process call to the correct application. The AXUIElementRef does no caching on its own.
-James
--------------------------------------------------
James Dempsey
AppKit Engineering
Apple
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden