Instance Method

showDefinitionForAttributedString:atPoint:

Shows a window displaying the definition of the attributed string at the specified point.

Declaration

- (void)showDefinitionForAttributedString:(NSAttributedString *)attrString atPoint:(NSPoint)textBaselineOrigin;

Parameters

attrString

The attributed string for which to show the definition. If the view is an instance of NSTextView, the attrString 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.

textBaselineOrigin

Specifies the baseline origin of attrString in the view's coordinate system.

Discussion

Shows a window that displays the definition (or other subject depending on available dictionaries) of the specified attributed string.

This method can be used for implementing the same functionality as the NSTextView “Look Up in Dictionary” contextual menu on a custom view.

See Also

Displaying Definition Windows

- showDefinitionForAttributedString:range:options:baselineOriginProvider:

Shows a window displaying the definition of the specified range of the attributed string.

NSDefinitionOptionKey

Keys to include in your definition.

NSDefinitionPresentationType

Presentation options for the window.