Re: Window closed notification
Re: Window closed notification
- Subject: Re: Window closed notification
- From: James Dempsey <email@hidden>
- Date: Mon, 21 Jun 2010 14:15:07 -0700
On Jun 21, 2010, at 2:03 PM, Ryan Joseph wrote:
>
> On Jun 21, 2010, at 1:00 PM, email@hidden wrote:
>
>> On Jun 20, 2010, at 5:45 PM, Ryan Joseph wrote:
>>
>>> Is there a way to get a notification when a window is closed or otherwise destroyed? This would seem like an obvious notification to get but I can't seem to find it anywhere in the reference docs
>>
>> You want the AXUIElementDestroyed notification. After a window is closed, a user can't use it, so the accessibility API considers it to have been destroyed even if the operating system still has it in memory somewhere.
>
>
> 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.
So, the approach you mention would make sense.
-James
>
> Regards,
> Josef
>
> _______________________________________________
> 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
--------------------------------------------------
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