I am able to set clickable links on NSTextField
elements, using NSAttributedString
. The text shows correctly (blue coloured, underlined) as soon as the view appears.
However, the cursor shows on hover is the editing (I-Beam) cursor, until first click (anywhere) on the NSTextField. Once it is clicked, when hovering over the "hyperlinked" part of the text, the hand point cursor is shown as expected.
I was able to subclass NSTextField
and override resetCursorRects, however, this allows me changing the cursor for the entire NSTextField bound, where I want it to show only when hovering over the hyperlinked parts of the text (Or to use cursorRects, but that seems as an overkill, to iterate on the (already iterated on creation) entire text).
I also tried setting the NSCursor
attribute of the attributed string, but that did not solve the issue.