Re: Screen reading contextual menus
Re: Screen reading contextual menus
- Subject: Re: Screen reading contextual menus
- From: Eric Schlegel <email@hidden>
- Date: Wed, 19 Mar 2003 09:32:49 -0800
On Wednesday, March 19, 2003, at 08:40 AM, Bill Cheeseman wrote:
I can successfully read a menu item in a contextual menu on the screen
with
AXUIElementCopyElementAtPosition. However, contextual menus disappear
the
moment you click on anything else on the screen. I therefore expected
to be
unable to use other functions afterwards -- for example, to obtain the
menu
item's attributes.
To my surprise, however, I am sometimes able to read the attributes
even
though the contextual menu is no longer visible. This appears to work
mainly
in Cocoa applications (Project Builder, for example, although not in
TextEdit). I haven't found a Carbon application in which it works.
What accounts for the fact that this sometimes works? Is it peculiar
to the
cocoa implementation of accessibility?
The ContextualMenuSelect API takes a MenuRef parameter which may either
be a pre-existing menu, or NULL. If NULL, the Menu Manager creates a
new MenuRef and destroys it before returning. My guess would be that
Cocoa (or Cocoa apps) tend to pre-create a MenuRef and populate it with
app-specific contextual menu items, and that this menu often (depending
on the app) continues to exist after the contextual menu has been
displayed. On the other hand, probably the Carbon apps that you've been
testing with are passing NULL to ContextualMenuSelect, so the menu only
exists during the menu display, and is destroyed immediately thereafter.
Is there a way to work around the disappearance of the contextual menu
in
Carbon applications?
Not if my hypothesis is correct; you can't control the lifetime of the
MenuRef in the application.
I don't need to perform actions on them; I just want to
let the user browse what was there while the contextual menu was open.
I
guess I could cache everything, but that would be a lot of work.
I think you'll just need to cache the information you're interested in.
-eric
_______________________________________________
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.