Re: AX callback not getting called...
Re: AX callback not getting called...
- Subject: Re: AX callback not getting called...
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 9 Jun 2010 06:25:49 -0400
On Jun 9, 2010, at 1:36 AM, charlie wrote:
> No matter what I do, how I change focus, how the accessibility prefs are setup... the callback is never triggered.
>
> Anyone see why?
Because you release observer and appelement immediately after creating them. They must be allowed to survive as long as you wish to observe the UI element and receive notifications.
One way to do this is to leave them alive until the application quits (i.e., never call CFRelease on them at all). A better way is to write an -invalidate method, which you can connect to a "stop observing" button or even call from your -dealloc method.
By the way, it is not enough to simply CFRelease the observer when you're done with it. You should also remove the notification and the run loop. Call AXObserverRemoveNotification to remove the notification, and then (assuming no other notifications are registered using the same observer) call CFRunLoopRemoveSource, and then finally CFRelease the observer.
(I assume you have enabled access in the Universal Access pane of System Preferences.)
--
Bill Cheeseman - 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