Shows a window displaying the definition of the specified range of the attributed string.
- macOS 10.6+
The attributed string for which to show the definition. If the view is an instance of NSTextView, the
attrvalue can be
nil, in which case the text view will automatically supply values suitable for displaying definitions for the specified range within its text content.
The range of the attributed string to define. You can pass a zero-length range and the appropriate range will be auto-detected around the range's offset. That's the recommended approach when there is no selection.
An optional dictionary that specifies how the definition is displayed. See NSDefinition Presentation Constants for the key and it’s possible values.
The originProvider block object should return the baseline origin for the first character at the adjusted range.
If the view is an instance of NSTextView, the originProvider can be
NULL, in which case the text view will automatically supply values suitable for displaying definitions for the specified range within its text content.
The block object takes a single argument:
The adjusted range.
The block object returns an
NSPointto be used as the baseline origin of the first character, in the view’s view coordinate system.
This method does not cause scrolling, so clients should perform any necessary scrolling before calling this method.