olha
olha

Reputation: 2262

How to make my program to behave like Dictionary in iBooks?

When I use iBooks on Mac, and highlight a word with a mouse, English Thesaurus is shown: enter image description here

I'd like my program to do similar thing - to appear like this Thesaurus in iBooks.
How can it be reached? The simplest idea is recognizing that some text is selected, but maybe iBooks has some API (nothing useful at https://developer.apple.com/ibooks/).
Or maybe Mac OS has event "single word selected", and I can subscribe for it.

What kind of app is best suited for that: Cocoa App or some extension/plugin?

I'm not interested in "long way" (context menu): enter image description here

Any advices will be highly appreciated, because I don't know anything about that.:)

Upvotes: 0

Views: 93

Answers (1)

CRD
CRD

Reputation: 53000

What I think you are looking for is NSView's showDefinitionForAttributedString:atPoint: method or one of its siblings. HTH

Upvotes: 1

Related Questions