Re: How to support dictionary service in a custom text view?
Re: How to support dictionary service in a custom text view?
- Subject: Re: How to support dictionary service in a custom text view?
- From: Charles Srstka <email@hidden>
- Date: Mon, 7 Jul 2008 22:14:20 -0500
On Jul 7, 2008, at 9:48 PM, Evan Gross wrote:
While supporting AX is always a good thing to do, the Dictionary
service
doesn't require access to be enabled. Have you tested at all with
accessibility off?
I'm not sure what you're referring to with regards to "accessibility
off". If you are referring to the "Allow access for assistive devices"
check box in the Universal Access preference pane, that isn't what I
was talking about at all. What I did was implement the methods in the
NSAccessibility informal protocol such as accessibilityAttributeNames,
accessibilityAttributeValue:,
accessibilityAttributeValue:forParameter:, and the rest. Implementing
these after having implemented NSTextInput caused the Dictionary
service to start working with my custom view.
I know that the Dictionary service *does* apparently make use of the
accessibility APIs, as if I set a breakpoint in the accessibility
methods, they get called quite a bit when one invokes the Dictionary
service via command-control-D with the mouse cursor over my view.
My product (well, the new version I'm working on) makes heavy use of
the
same TSM and AX APIs that the Dictionary service uses (and a few
other). I'd
be very interested to see a custom NSView that's not derived from
NSTextView
that supports these APIs (to know that someone has done it!).
It's not complicated - all you have to do is implement the
NSAccessibility APIs (you might have to implement NSTextInput as well
- I did before I implemented NSAccessibility, so I don't know whether
it would have worked without NSTextInput or not. Regardless,
NSTextInput is something you always want to implement anyway if you're
making a text view). When you do this, it suddenly Just Works™, just
like NSTextView.
Charles_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden