Re: NSSearchField not accessible?
Re: NSSearchField not accessible?
- Subject: Re: NSSearchField not accessible?
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 29 May 2006 12:16:37 -0400
- Thread-topic: NSSearchField not accessible?
on 2006-05-29 7:56 AM, Håkan Waara at email@hidden wrote:
> We have found that NSSearchFields don't seem to have an accessible
> way of invoking the menu that it may provide via the looking glass
> icon, using the keyboard.
>
> Using the Accessibility inspector, I saw the "ShowMenu" action, but
> that just brought up the normal text editing context menu on the
> textfield.
>
> Of course a third-party could invoke the menu programmatically, but
> I'd like to see some standard non-ad hoc keyboard shortcut for this.
I don't believe developers can easily get at the search menu
programmatically, at least in Cocoa. It is built into the search field cell,
and neither the NSSearchField class nor the NSSearchFieldCell class has any
method to get the search menu.
To access the search field cell's menu in an application I wrote, I had to
write a category on NSSearchFieldCell and access its _searchMenu private
instance variable. Of course, any use of private Cocoa variables is risky.
Here's my category method:
- (NSMenu *)WRSearchMenu {
return _searchMenu; // private instance variable
}
My guess is that Apple did not want to make the search menu available
programmatically for fear that doing so might interfere with the template
scheme for controlling the content of search menus. But my category method
is working perfectly well for my purposes: I wanted to add items to the
search menu on the fly in a Core Data application, so that the menu would
accurately reflect certain features added to the app's interface by a user.
I believe Apple should make the search menu available programmatically.
> Is this a known issue? How do you suggest to make it accessible, if
> that responsibility is on the developer?
I assume that it is inaccessible from the accessibility API for the same
reason, but this does mean that assistive applications can't read or use the
search menu. I believe this can only be fixed by Apple, unless you can find
a way to use my category technique to supply the missing accessibility
information yourself.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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