Re: Multiple notifications
Re: Multiple notifications
- Subject: Re: Multiple notifications
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 19 Nov 2002 16:55:24 -0500
on 02-11-19 12:58 PM, Mike Engber at email@hidden wrote:
>
> When I create an observer for my target application and register it to
>
> receive an application-activated notification on the root UIElement, I
>
> always get two notifications when I activate the target application.
>
>
I can repro this and it seems like a bug. I'll look into it a bit and
>
file one.
I'm seeing the double-pump action in a way that might yield a clue. I'm
putting an array containing three items into the refcon parameter when I
register a notification. On the first callback, the contents of the refcon
are correct -- the same array containing the same three items that I
registered with. On the second callback, the refcon parameter contains a
valid array, but it has only two items in it -- so of course I crash with an
array bounds error in the callback function the second time. The two items
in the second array are different from the first two items in the first
array. On the second callback, the array in the refcon is an array I use as
a key to a dictionary in several other places. I'll follow up and try to
track it down in a couple of days.
By the way, the deactivate-application notification also causes two
callbacks.
>
> In other circumstances, I am seeing multiple notifications with a null
>
> role.
>
> For example, after registering for a UIElement-destroyed notification
>
> on a
>
> window in TextEdit, I get 6 or 7 UIElement destroyed notifications
>
> listing a
>
> null role when I close the TextEdit window.
>
>
You should never get a null role. Are you only seeing these in response
>
to
>
a destroyed notification? If so, then I'll bet you're not getting a
>
null role,
>
you're getting an invalid ui element error. The element is destroyed so
>
you can't
>
really use it anymore. The only good that it does you at this point is
>
passing
>
to CFEqual so you can remove any refs you have cached.
I haven't played with this issue enough yet to answer your questions. I'll
rig my accessibility browser so it returns a complete list of all attributes
of all affected elements for all callbacks, to help me diagnose the issues.
--
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
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.